1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.geronimo.ews.ws4j2ee.context.webservices.server;
18
19 import org.apache.axis.wsdl.fromJava.Emitter;
20 import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
21 import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext;
22 import org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFWebserviceDescription;
23 import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
24
25 /***
26 * @author Srinath Perera(hemapani@opensource.lk)
27 * @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.interfaces.WSCFContext
28 */
29 public class AxisEmitterBasedWSCFContext extends AbstractWSCFContext implements WSCFContext {
30 private Emitter emitter;
31 private J2EEWebServiceContext j2eeweserviceContext;
32
33 public AxisEmitterBasedWSCFContext(Emitter emitter, J2EEWebServiceContext j2eeweserviceContext) {
34 this.emitter = emitter;
35 this.j2eeweserviceContext = j2eeweserviceContext;
36 }
37
38
39
40
41 public String getDescription() {
42 throw new UnsupportedOperationException();
43 }
44
45
46
47
48 public String getDisplayName() {
49 throw new UnsupportedOperationException();
50 }
51
52
53
54
55 public String getLargeIcon() {
56 throw new UnsupportedOperationException();
57 }
58
59
60
61
62 public String getSmallIcon() {
63 throw new UnsupportedOperationException();
64 }
65
66
67
68
69 public WSCFWebserviceDescription[] getWebServicesDescription() {
70 throw new UnsupportedOperationException();
71 }
72
73 public void serialize(java.io.Writer out) throws GenerationFault {
74 try {
75 out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
76 out.write("<webservices xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n");
77 out.write("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\n");
78 out.write("xmlns:ns1=\"http://www.Monson-Haefel.com/jwsbook/BookQuote\n");
79 out.write("xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n");
80 out.write("http://www.ibm.com/standards/xml/webservices/j2ee/j2ee_web_services_1_1.xsd\" version=\"1.1\">\n");
81 out.write("<webservice-description>\n");
82 out.write("<webservice-description-name>" + emitter.getServiceElementName() + "</webservice-description-name>\n");
83 out.write("<wsdl-file>" + j2eeweserviceContext.getMiscInfo().getWsdlFile() + "</wsdl-file>\n");
84 out.write("<jaxrpc-mapping-file>" + j2eeweserviceContext.getMiscInfo().getJaxrpcfile() + "</jaxrpc-mapping-file>\n");
85 out.write("<port-component>\n");
86 out.write("<port-component-name>" + emitter.getPortTypeName() + "</port-component-name>\n");
87 out.write("<wsdl-port xmlns:ns1=\"" + j2eeweserviceContext.getWSDLContext().getTargetNSURI() + "\">\n");
88 out.write("ns1:" + j2eeweserviceContext.getWSDLContext().getTargetPort().getName());
89 out.write("</wsdl-port>\n");
90 out.write("<service-endpoint-interface>" + emitter.getCls().getName() + "</service-endpoint-interface>\n");
91 out.write("<service-impl-bean>\n");
92
93
94
95 String ejbName = j2eeweserviceContext.getMiscInfo().getJ2eeComponetLink();
96 if (ejbName == null)
97 ejbName = emitter.getPortTypeName();
98 out.write("<ejb-link >" + ejbName + "</ejb-link>\n");
99 out.write("</service-impl-bean>\n");
100 out.write("</port-component>\n");
101 out.write("</webservice-description>\n");
102 out.write("</webservices>\n");
103 } catch (Exception e) {
104 }
105 }
106
107 }