MTOM is a method to efficiently send binary data to and from Web services. MTOM is usually used with the XOP.
In your sender application (usually where webservice provider resides), perform below:
- create a service whose output is a XOPObject
- get content of file as stream using “pub.file:getFile”
- create XOP object using “pub.soap.utils:createXOPObject” and map the outcome to service output
- expose your service as a webservice provider
- set “Attachments enabled” to “true” on the provider
- set “watt.server.SOAP.MTOMThreshold=” property with the appropriate value. This property specifies the field size, in kilobytes.
On your consumer application:
- create a webservice consumer for above webservice
- write a flow service which calls connector
- get the XOP object as response and use “pub.soap.utils:getXOPObjectContent” to get the stream content
- convert stream to file back
If you want to allow streamed MTOM attachments in inbound messages, configure the following server configuration parameters:
- Set the watt.server.SOAP.MTOMStreaming.enable server configuration parameter to true to enable MTOM streaming.
- Configure the watt.server.SOAP.MTOMStreaming.cachedFiles.location server configuration parameter to identify the location where Integration Server temporarily caches the MTOM attachments.
- Configure the watt.server.SOAP.MTOMStreaming.threshold server configuration parameter to specify the number of bytes an MTOM attachment in an inbound SOAP message must be before Integration Server uses MTOM streaming for the MTOM attachment.
#webMethods#Integration-Server-and-ESB