001: /**
002: * $Id: WebServiceDescriptor.java,v 1.8 2003/12/01 10:47:36 vv138407 Exp $
003: * Copyright 2002-2003 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.providers.simplewebservice;
014:
015: /**
016: * The WebServiceDescriptor encapsulates all the information
017: * required to invoke a method on a given web service.
018: *
019: */
020: public class WebServiceDescriptor {
021:
022: public static final String ENC_ENCODED = "encoded";
023: public static final String ENC_LITERAL = "literal";
024:
025: public static final String RPC_SOAP_BINDING_STYLE = "rpc";
026: public static final String DOCUMENT_SOAP_BINDING_STYLE = "document";
027:
028: private String wsdlURL = null;
029: private String serviceName = null;
030: private String portName = null;
031: private String methodName = null;
032: private String inputNamespace = null;
033: private String outputNamespace = null;
034: private String inputEncodingStyle = null;
035: private String outputEncodingStyle = null;
036: private String inputEncodingStyleURI = null;
037: private String outputEncodingStyleURI = null;
038: private String endPointURL = null;
039: private ParameterDescriptor[] inputParams = null;
040: private ParameterDescriptor[] outputParams = null;
041: private String soapBindingStyle = null;
042: private String soapBindingTransport = null;
043: private String soapAction = null;
044: private String documentation = null;
045: private boolean isOneway = false;
046:
047: /**
048: * Default constructor.
049: *
050: * @param wsdlURL the WSDL URL for the web service.
051: * @param serviceName the name of the web service to invoke.
052: * @param portName the name of the port associated with the web service.
053: * @param methodName the name of the method to invoke on the web service.
054: * @param endPointURL the end point URL for the web service.
055: * @param inputNamespace the input namespace for the web service.
056: * @param outputNamespace the output namespace for the web service.
057: * @param inputEncodingStyle the input encoding style (eg- "encoded" or "literal")
058: for the web service.
059: * @param outputEncodingStyle the output encoding style (eg- "encoded" or "literal")
060: for the web service.
061: * @param inputEncodingStyleURI the input encoding style URI for the web service.
062: * @param outputEncodingStyleURI the output encoding style URI for the web service.
063: * @param input the array of input ParameterDescriptors for the web service.
064: * @param output the output ParameterDescriptor for the web service.
065: * @param soapBindingStyle the SOAP Binding Style.
066: * @param soapBindingTransport the SOAP Binding Transport.
067: * @param soapAction the SOAP Action.
068: * @param documentation documentation about the method to invoke on the web service.
069: */
070: public WebServiceDescriptor(String wsdlURL, String serviceName,
071: String portName, String methodName, String endPointURL,
072: String inputNamespace, String outputNamespace,
073: String inputEncodingStyle, String outputEncodingStyle,
074: String inputEncodingStyleURI,
075: String outputEncodingStyleURI, ParameterDescriptor[] input,
076: ParameterDescriptor[] output, String soapBindingStyle,
077: String soapBindingTransport, String soapAction,
078: String documentation) {
079: this .wsdlURL = wsdlURL;
080: this .serviceName = serviceName;
081: this .portName = portName;
082: this .methodName = methodName;
083: this .endPointURL = endPointURL;
084: this .inputNamespace = inputNamespace;
085: this .outputNamespace = outputNamespace;
086: this .inputEncodingStyle = inputEncodingStyle;
087: this .outputEncodingStyle = outputEncodingStyle;
088: this .inputEncodingStyleURI = inputEncodingStyleURI;
089: this .outputEncodingStyleURI = outputEncodingStyleURI;
090: this .inputParams = input;
091: this .outputParams = output;
092: this .soapBindingStyle = soapBindingStyle;
093: this .soapBindingTransport = soapBindingTransport;
094: this .soapAction = soapAction;
095: this .documentation = documentation;
096: }
097:
098: /**
099: * Get the WSDL URL for the web service.
100: *
101: * @return the WSDL URL for the web service.
102: */
103: public String getWSDLURL() {
104: return wsdlURL;
105: }
106:
107: /**
108: * Get the web service name.
109: *
110: * @return the name for the web service.
111: */
112: public String getServiceName() {
113: return serviceName;
114: }
115:
116: /**
117: * Get the web service port name.
118: *
119: * @return the port name for the web service.
120: */
121: public String getPortName() {
122: return portName;
123: }
124:
125: /**
126: * Get the name of the method to invoke on
127: * the web service.
128: *
129: * @return the method name for the web service.
130: */
131: public String getMethodName() {
132: return methodName;
133: }
134:
135: /**
136: * Get the input namespace for the web service.
137: *
138: * @return the input namespace for the web service.
139: */
140: public String getInputNamespace() {
141: return inputNamespace;
142: }
143:
144: /**
145: * Get the output namespace for the web service.
146: *
147: * @return the output namespace for the web service.
148: */
149: public String getOutputNamespace() {
150: return outputNamespace;
151: }
152:
153: /**
154: * Get the input encoding style (eg- "literal" or "encoded"
155: * to the web service call.
156: *
157: * @return the input encoding sytle applicable to the
158: * web service call.
159: */
160: public String getInputEncodingStyle() {
161: return inputEncodingStyle;
162: }
163:
164: /**
165: * Get the output encoding style (eg- "literal" or "encoded"
166: * to the web service call.
167: *
168: * @return the output encoding sytle applicable to the
169: * web service call.
170: */
171: public String getOutputEncodingStyle() {
172: return outputEncodingStyle;
173: }
174:
175: /**
176: * Get the input encoding style URI for the web service call.
177: *
178: * @return the input encoding sytle URI applicable to the
179: * web service call.
180: */
181: public String getInputEncodingStyleURI() {
182: return inputEncodingStyleURI;
183: }
184:
185: /**
186: * Get the output encoding style URI for the web service call.
187: *
188: * @return the output encoding sytle URI applicable to the
189: * web service call.
190: */
191: public String getOutputEncodingStyleURI() {
192: return outputEncodingStyleURI;
193: }
194:
195: /**
196: * Get the input parameters required to invoke the
197: * method on the web service.
198: *
199: * @return an array of input parameters for the
200: * web service method call.
201: */
202: public ParameterDescriptor[] getInputParams() {
203: return inputParams;
204: }
205:
206: /**
207: * Get the output param used when returning results
208: * from the method invocation on the web service.
209: *
210: * @return the output parameter for the web service method call.
211: */
212: public ParameterDescriptor[] getOutputParams() {
213: return outputParams;
214: }
215:
216: /**
217: * Get the end point URL for the web service call.
218: *
219: * @return the end point URL for the web service call.
220: */
221: public String getEndPointURL() {
222: return endPointURL;
223: }
224:
225: /**
226: * Get the SOAP Binding Style.
227: *
228: * @return the SOAP Binding Style.
229: */
230: public String getSOAPBindingStyle() {
231: return soapBindingStyle;
232: }
233:
234: /**
235: * Get the SOAP Binding Transport.
236: *
237: * @return the SOAP Binding Transport.
238: */
239: public String getSOAPBindingTransport() {
240: return soapBindingTransport;
241: }
242:
243: /**
244: * Get the SOAP Action for the Binding operation.
245: *
246: * @return the SOAP Action.
247: */
248: public String getSOAPAction() {
249: return soapAction;
250: }
251:
252: /**
253: * Get the documentation (if avilable) on the method to
254: * be invoked on the web service.
255: *
256: * @return documentation on the web service method being
257: * invoked.
258: */
259: public String getDocumentation() {
260: return documentation;
261: }
262:
263: public boolean isOneWayOperation() {
264: return isOneway;
265: }
266:
267: public void setOneWayOperation(boolean oneway) {
268: this .isOneway = oneway;
269: }
270:
271: /**
272: * Get the string representation of this WebServiceDescriptor.
273: *
274: * @return the string representation of this WebServiceDescriptor.
275: */
276: public String toString() {
277: StringBuffer buf = new StringBuffer();
278:
279: buf.append("WebServiceDescriptor- ");
280:
281: buf.append("WSDL URL:" + wsdlURL).append("\n").append(
282: "ServiceName:" + serviceName).append("\n").append(
283: "PortName:" + portName).append("\n").append(
284: "MethodName:" + methodName).append("\n").append(
285: "Input Namespace:" + inputNamespace).append("\n")
286: .append("Output Namespace:" + outputNamespace).append(
287: "\n").append(
288: "Input Encoding Style:" + inputEncodingStyle)
289: .append("\n").append(
290: "Output Encoding Style:" + outputEncodingStyle)
291: .append("\n").append(
292: "Input Encoding Style URI:"
293: + inputEncodingStyleURI).append("\n")
294: .append(
295: "Output Encoding Style URI:"
296: + outputEncodingStyleURI).append("\n")
297: .append("EndPointURL:" + getEndPointURL()).append("\n")
298: .append("soapBindingStyle:" + getSOAPBindingStyle())
299: .append("\n").append(
300: "soapBindingTransport:"
301: + getSOAPBindingTransport()).append(
302: "\n").append("soapAction:" + getSOAPAction())
303: .append("\n");
304:
305: for (int i = 0; inputParams != null && i < inputParams.length; i++) {
306: buf.append(inputParams[i].toString()).append("\n");
307: }
308:
309: for (int i = 0; outputParams != null && i < outputParams.length; i++) {
310: buf.append(outputParams[i].toString()).append("\n");
311: }
312:
313: if (documentation != null) {
314: buf.append("Documentation:" + documentation).append("\n");
315: }
316:
317: return buf.toString();
318: }
319:
320: }
|