001: /*
002: * The Apache Software License, Version 1.1
003: *
004: *
005: * Copyright (c) 2002 The Apache Software Foundation. All rights
006: * reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * 1. Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * 2. Redistributions in binary form must reproduce the above copyright
016: * notice, this list of conditions and the following disclaimer in
017: * the documentation and/or other materials provided with the
018: * distribution.
019: *
020: * 3. The end-user documentation included with the redistribution,
021: * if any, must include the following acknowledgment:
022: * "This product includes software developed by the
023: * Apache Software Foundation (http://www.apache.org/)."
024: * Alternately, this acknowledgment may appear in the software itself,
025: * if and wherever such third-party acknowledgments normally appear.
026: *
027: * 4. The names "WSIF" and "Apache Software Foundation" must
028: * not be used to endorse or promote products derived from this
029: * software without prior written permission. For written
030: * permission, please contact apache@apache.org.
031: *
032: * 5. Products derived from this software may not be called "Apache",
033: * nor may "Apache" appear in their name, without prior written
034: * permission of the Apache Software Foundation.
035: *
036: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
037: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
038: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
039: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
040: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
041: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
042: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
043: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
044: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
045: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
046: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
047: * SUCH DAMAGE.
048: * ====================================================================
049: *
050: * This software consists of voluntary contributions made by many
051: * individuals on behalf of the Apache Software Foundation and was
052: * originally based on software copyright (c) 2001, 2002, International
053: * Business Machines, Inc., http://www.apache.org. For more
054: * information on the Apache Software Foundation, please see
055: * <http://www.apache.org/>.
056: */
057:
058: package soapinterop;
059:
060: import javax.xml.namespace.QName;
061:
062: import org.apache.wsif.WSIFException;
063: import org.apache.wsif.WSIFMessage;
064: import org.apache.wsif.WSIFOperation;
065: import org.apache.wsif.WSIFPort;
066: import org.apache.wsif.WSIFService;
067: import org.apache.wsif.WSIFServiceFactory;
068: import org.apache.wsif.providers.soap.apachesoap.WSIFDynamicProvider_ApacheSOAP;
069: import org.apache.wsif.util.WSIFPluggableProviders;
070: import util.TestUtilities;
071:
072: /**
073: * InteropTestServiceProxy
074: */
075: public class InteropTestServiceProxy {
076: private WSIFServiceFactory factory;
077: private WSIFService svc;
078: String wsdlLocation = //"com/ibm/wsif/test/soapinterop/ApacheAxis.wsdl";
079: TestUtilities.getWsdlPath("java\\test\\soapinterop")
080: + "ApacheAxis.wsdl";
081:
082: /**
083: * getPortFactory
084: * @generated
085: */
086: /* public WSIFDynamicPortFactory getPortFactory() {
087: return fieldPortFactory;
088: }*/
089: /**
090: * setPortFactory
091: * @generated
092: */
093: /* public void setPortFactory(WSIFDynamicPortFactory newPortFactory) {
094: fieldPortFactory= newPortFactory;
095: }*/
096:
097: /**
098: * echoString
099: * @generated
100: */
101: public java.lang.String echoString(java.lang.String argInputString)
102: throws WSIFException {
103:
104: WSIFPort port = this .svc.getPort();
105:
106: WSIFOperation operation = port.createOperation("echoString",
107: null, null);
108:
109: WSIFMessage inputMessage = operation.createInputMessage();
110:
111: WSIFMessage outputMessage = operation.createOutputMessage();
112:
113: inputMessage.setObjectPart("inputString", argInputString);
114:
115: operation.executeRequestResponseOperation(inputMessage,
116: outputMessage, null);
117:
118: port.close();
119:
120: return (java.lang.String) outputMessage.getObjectPart("return");
121:
122: }
123:
124: /**
125: * echoStringArray
126: * @generated
127: */
128: public java.lang.String[] echoStringArray(
129: java.lang.String[] argInputStringArray)
130: throws WSIFException {
131:
132: WSIFPort port = this .svc.getPort();
133:
134: WSIFOperation operation = port.createOperation(
135: "echoStringArray", "echoStringArrayRequest",
136: "echoStringArrayResponse");
137:
138: WSIFMessage inputMessage = operation.createInputMessage();
139: inputMessage.setName("echoStringArrayRequest");
140:
141: WSIFMessage outputMessage = operation.createOutputMessage();
142: outputMessage.setName("echoStringArrayResponse");
143:
144: inputMessage.setObjectPart("inputStringArray",
145: argInputStringArray);
146:
147: operation.executeRequestResponseOperation(inputMessage,
148: outputMessage, null);
149:
150: port.close();
151:
152: return (java.lang.String[]) outputMessage
153: .getObjectPart("return");
154:
155: }
156:
157: /**
158: * echoInteger
159: * @generated
160: */
161: public int echoInteger(int argInputInteger) throws WSIFException {
162:
163: WSIFPort port = this .svc.getPort();
164:
165: WSIFOperation operation = port.createOperation("echoInteger",
166: "echoIntegerRequest", "echoIntegerResponse");
167:
168: WSIFMessage inputMessage = operation.createInputMessage();
169: inputMessage.setName("echoIntegerRequest");
170:
171: WSIFMessage outputMessage = operation.createOutputMessage();
172: outputMessage.setName("echoIntegerResponse");
173:
174: inputMessage.setObjectPart("inputInteger",
175: new java.lang.Integer(argInputInteger));
176:
177: operation.executeRequestResponseOperation(inputMessage,
178: outputMessage, null);
179:
180: port.close();
181:
182: return ((java.lang.Integer) outputMessage
183: .getObjectPart("return")).intValue();
184:
185: }
186:
187: /**
188: * echoIntegerArray
189: * @generated
190: */
191: public int[] echoIntegerArray(int[] argInputIntegerArray)
192: throws WSIFException {
193:
194: WSIFPort port = this .svc.getPort();
195:
196: WSIFOperation operation = port.createOperation(
197: "echoIntegerArray", "echoIntegerArrayRequest",
198: "echoIntegerArrayResponse");
199:
200: WSIFMessage inputMessage = operation.createInputMessage();
201: inputMessage.setName("echoIntegerArrayRequest");
202:
203: WSIFMessage outputMessage = operation.createOutputMessage();
204: outputMessage.setName("echoIntegerArrayResponse");
205:
206: inputMessage.setObjectPart("inputIntegerArray",
207: argInputIntegerArray);
208:
209: operation.executeRequestResponseOperation(inputMessage,
210: outputMessage, null);
211:
212: port.close();
213:
214: return (int[]) outputMessage.getObjectPart("return");
215:
216: }
217:
218: /**
219: * echoFloat
220: * @generated
221: */
222: public float echoFloat(float argInputFloat) throws WSIFException {
223:
224: WSIFPort port = this .svc.getPort();
225:
226: WSIFOperation operation = port.createOperation("echoFloat",
227: "echoFloatRequest", "echoFloatResponse");
228:
229: WSIFMessage inputMessage = operation.createInputMessage();
230: inputMessage.setName("echoFloatRequest");
231:
232: WSIFMessage outputMessage = operation.createOutputMessage();
233: outputMessage.setName("echoFloatResponse");
234:
235: inputMessage.setObjectPart("inputFloat", new java.lang.Float(
236: argInputFloat));
237:
238: operation.executeRequestResponseOperation(inputMessage,
239: outputMessage, null);
240:
241: port.close();
242:
243: return ((java.lang.Float) outputMessage.getObjectPart("return"))
244: .floatValue();
245:
246: }
247:
248: /**
249: * echoFloatArray
250: * @generated
251: */
252: public float[] echoFloatArray(float[] argInputFloatArray)
253: throws WSIFException {
254:
255: WSIFPort port = this .svc.getPort();
256:
257: WSIFOperation operation = port.createOperation(
258: "echoFloatArray", "echoFloatArrayRequest",
259: "echoFloatArrayResponse");
260:
261: WSIFMessage inputMessage = operation.createInputMessage();
262: inputMessage.setName("echoFloatArrayRequest");
263:
264: WSIFMessage outputMessage = operation.createOutputMessage();
265: outputMessage.setName("echoFloatArrayResponse");
266:
267: inputMessage.setObjectPart("inputFloatArray",
268: argInputFloatArray);
269:
270: operation.executeRequestResponseOperation(inputMessage,
271: outputMessage, null);
272:
273: port.close();
274:
275: return (float[]) outputMessage.getObjectPart("return");
276:
277: }
278:
279: /**
280: * echoStruct
281: * @generated
282: */
283: /* public org.soapinterop.xsd.SOAPStruct echoStruct(
284: org.soapinterop.xsd.SOAPStruct argInputStruct)
285: throws WSIFException {
286:
287: WSIFPort port = this.svc.getPort();
288:
289: WSIFOperation operation =
290: port.createOperation("echoStruct", "echoStructRequest", "echoStructResponse");
291:
292: WSIFMessage inputMessage = operation.createInputMessage();
293: inputMessage.setName("echoStructRequest");
294:
295: WSIFMessage outputMessage = operation.createOutputMessage();
296: outputMessage.setName("echoStructResponse");
297:
298: inputMessage.setObjectPart("inputStruct", argInputStruct);
299:
300: operation.executeRequestResponseOperation(inputMessage, outputMessage, null);
301:
302: port.close();
303:
304: return (org.soapinterop.xsd.SOAPStruct) outputMessage.getObjectPart("return");
305:
306: }*/
307:
308: /**
309: * echoStructArray
310: * @generated
311: */
312: /* public org.soapinterop.xsd.SOAPStruct[] echoStructArray(
313: org.soapinterop.xsd.SOAPStruct[] argInputStructArray)
314: throws WSIFException {
315:
316: WSIFPort port = this.svc.getPort();
317:
318: WSIFOperation operation =
319: port.createOperation(
320: "echoStructArray",
321: "echoStructArrayRequest",
322: "echoStructArrayResponse");
323:
324: WSIFMessage inputMessage = operation.createInputMessage();
325: inputMessage.setName("echoStructArrayRequest");
326:
327: WSIFMessage outputMessage = operation.createOutputMessage();
328: outputMessage.setName("echoStructArrayResponse");
329:
330: inputMessage.setObjectPart("inputStructArray", argInputStructArray);
331:
332: operation.executeRequestResponseOperation(inputMessage, outputMessage, null);
333:
334: port.close();
335:
336: return (org.soapinterop.xsd.SOAPStruct[]) outputMessage.getObjectPart("return");
337:
338: }*/
339:
340: /**
341: * echoVoid
342: * @generated
343: */
344: public void echoVoid() throws WSIFException {
345:
346: WSIFPort port = this .svc.getPort();
347:
348: WSIFOperation operation = port.createOperation("echoVoid",
349: "echoVoidRequest", "echoVoidResponse");
350:
351: WSIFMessage inputMessage = operation.createInputMessage();
352: inputMessage.setName("echoVoidRequest");
353:
354: WSIFMessage outputMessage = operation.createOutputMessage();
355: outputMessage.setName("echoVoidResponse");
356:
357: operation.executeRequestResponseOperation(inputMessage,
358: outputMessage, null);
359:
360: port.close();
361:
362: }
363:
364: /**
365: * echoBase64
366: * @generated
367: */
368: public byte[] echoBase64(byte[] argInputBase64)
369: throws WSIFException {
370:
371: WSIFPort port = this .svc.getPort();
372:
373: WSIFOperation operation = port.createOperation("echoBase64",
374: "echoBase64Request", "echoBase64Response");
375:
376: WSIFMessage inputMessage = operation.createInputMessage();
377: inputMessage.setName("echoBase64Request");
378:
379: WSIFMessage outputMessage = operation.createOutputMessage();
380: outputMessage.setName("echoBase64Response");
381:
382: inputMessage.setObjectPart("inputBase64", argInputBase64);
383:
384: operation.executeRequestResponseOperation(inputMessage,
385: outputMessage, null);
386:
387: port.close();
388:
389: return (byte[]) outputMessage.getObjectPart("return");
390:
391: }
392:
393: /**
394: * echoDate
395: * @generated
396: */
397: public java.util.Date echoDate(java.util.Date argInputDate)
398: throws WSIFException {
399:
400: WSIFPort port = this .svc.getPort();
401:
402: WSIFOperation operation = port.createOperation("echoDate",
403: "echoDateRequest", "echoDateResponse");
404:
405: WSIFMessage inputMessage = operation.createInputMessage();
406: inputMessage.setName("echoDateRequest");
407:
408: WSIFMessage outputMessage = operation.createOutputMessage();
409: outputMessage.setName("echoDateResponse");
410:
411: inputMessage.setObjectPart("inputDate", argInputDate);
412:
413: operation.executeRequestResponseOperation(inputMessage,
414: outputMessage, null);
415:
416: port.close();
417:
418: return (java.util.Date) outputMessage.getObjectPart("return");
419:
420: }
421:
422: /**
423: * echoHexBinary
424: * @generated
425: */
426: public byte[] echoHexBinary(byte[] argInputHexBinary)
427: throws WSIFException {
428:
429: WSIFPort port = this .svc.getPort();
430:
431: WSIFOperation operation = port.createOperation("echoHexBinary",
432: "echoHexBinaryRequest", "echoHexBinaryResponse");
433:
434: WSIFMessage inputMessage = operation.createInputMessage();
435: inputMessage.setName("echoHexBinaryRequest");
436:
437: WSIFMessage outputMessage = operation.createOutputMessage();
438: outputMessage.setName("echoHexBinaryResponse");
439:
440: inputMessage.setObjectPart("inputHexBinary", argInputHexBinary);
441:
442: operation.executeRequestResponseOperation(inputMessage,
443: outputMessage, null);
444:
445: port.close();
446:
447: return (byte[]) outputMessage.getObjectPart("return");
448:
449: }
450:
451: /**
452: * echoDecimal
453: * @generated
454: */
455: public java.math.BigDecimal echoDecimal(
456: java.math.BigDecimal argInputDecimal) throws WSIFException {
457:
458: WSIFPort port = this .svc.getPort();
459:
460: WSIFOperation operation = port.createOperation("echoDecimal",
461: "echoDecimalRequest", "echoDecimalResponse");
462:
463: WSIFMessage inputMessage = operation.createInputMessage();
464: inputMessage.setName("echoDecimalRequest");
465:
466: WSIFMessage outputMessage = operation.createOutputMessage();
467: outputMessage.setName("echoDecimalResponse");
468:
469: inputMessage.setObjectPart("inputDecimal", argInputDecimal);
470:
471: operation.executeRequestResponseOperation(inputMessage,
472: outputMessage, null);
473:
474: port.close();
475:
476: return (java.math.BigDecimal) outputMessage
477: .getObjectPart("return");
478:
479: }
480:
481: /**
482: * echoBoolean
483: * @generated
484: */
485: public boolean echoBoolean(boolean argInputBoolean)
486: throws WSIFException {
487:
488: WSIFPort port = this .svc.getPort();
489:
490: WSIFOperation operation = port.createOperation("echoBoolean",
491: "echoBooleanRequest", "echoBooleanResponse");
492:
493: WSIFMessage inputMessage = operation.createInputMessage();
494: inputMessage.setName("echoBooleanRequest");
495:
496: WSIFMessage outputMessage = operation.createOutputMessage();
497: outputMessage.setName("echoBooleanResponse");
498:
499: inputMessage.setObjectPart("inputBoolean",
500: new java.lang.Boolean(argInputBoolean));
501:
502: operation.executeRequestResponseOperation(inputMessage,
503: outputMessage, null);
504:
505: port.close();
506:
507: return ((java.lang.Boolean) outputMessage
508: .getObjectPart("return")).booleanValue();
509:
510: }
511:
512: /**
513: * Constructor
514: * @generated
515: */
516: public InteropTestServiceProxy() throws WSIFException {
517:
518: this .factory = WSIFServiceFactory.newInstance();
519:
520: WSIFPluggableProviders.overrideDefaultProvider(
521: "http://schemas.xmlsoap.org/wsdl/soap/",
522: new WSIFDynamicProvider_ApacheSOAP());
523:
524: this .svc = factory.getService(wsdlLocation,
525: //this.getClass().getClassLoader(),
526: "http://soapinterop.org/", "interopLab",
527: "http://soapinterop.org/", "InteropTestPortType");
528:
529: if (this .svc == null)
530: throw new WSIFException(
531: "Failed to create WSIFDynamicPortFactory");
532: //this.svc.mapType(
533: // new QName("http://soapinterop.org/xsd", "SOAPStruct"),
534: // SOAPStruct.class);
535: this .svc.mapType(new QName("http://soapinterop.org/xsd",
536: "ArrayOfstring"), java.lang.String[].class);
537: this .svc.mapType(new QName("http://soapinterop.org/xsd",
538: "ArrayOfint"), int[].class);
539: //this.svc.mapType(
540: // new QName("http://soapinterop.org/xsd", "ArrayOfSOAPStruct"),
541: // SOAPStruct[].class);
542: this .svc.mapType(new QName("http://soapinterop.org/xsd",
543: "ArrayOffloat"), float[].class);
544:
545: }
546:
547: }
|