How to Create an MTOM Web Service Component |
this=new com.usoft.WebServiceClient.WSClient() this.setEndpointURL((U):0) this.setInputFolder((U):1) this.setOutputFolder((U):2) The constructor method must have the same name as the component.
where:
this.setEndpointURL((U):0) this.setInputFolder((U):1) and remove the output_folder input parameter.
Example of constructor SQL: SELECT 'http://www.test.com/TestingMtom', 'C:/Input/', 'C:/Output'
this.sendSOAPMessage((U) :0, (U) :1, (U) :2)
where:
Example: <MTOMMessage xmlns="http://www.test.com/TestMtom/v1"> <request> <BinaryData><?usoft-mtom path="TestMTOM.doc"?></BinaryData> </request>
You can now execute a call to this service in your application: INVOKE <web service component name>.<method name> WITH SELECT '<MTOMMessage xmlns="http://www.test.com/TestMtom/v1"> <request> <BinaryData><?usoft-mtom path="TestMTOM.doc"?></BinaryData> </request> </ MTOMMessage >', null, 'http://www.test.com/TestMtom/action1' If the response has binary data in MTOM encoding, that data will be saved into files. The files are saved in the location specified by the output folder in the constructor method. The (unique) file names are generated by USoft without extensions and they will be returned in a USoft processing instruction in the element where the binary data should be. Example of response: <soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > <soap:Body> <MTOMResponse xmlns="http://www.test.com/TestMtom/v1"> <result> <BinaryData> <?usoft-mtom path="C:\Output\2d33366539343139613a31313161333034366335373a2d37666666_20070330152414114"?> </BinaryData> </result> </ MTOMResponse> </soap:Body> </soap:Envelope> |