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.
Actually we are able to do MTOM Stream with webServices but the problem here is subscription application doesnot supports to webServices it only support HTTP POST. so kindly help us with how to achieve the same using HTTP POST.
Please do let me know if you want any more information in detail.
When using MTOM streaming, the messageContext variables and/or XOPObject fields will
not be available in the pipeline that is saved when using:
? Audit logging when the pipeline is included
? Service caching
? pub.flow:savePipeline or pub.flow:savePipelineToFile services
? Transient error handling for a service
I have tried by specifying the cid in the request and i can see the base64 encoding of the attachment in the request string. But the requirement is to send the attachment as MTOM, not as field.
As the SOAP message itself is contained in one part, and the binary content is in a separate part. The content element in the SOAP message just has a reference to the binary part. Hence you should use the same reference ( ContentID in attachment should be same as XOPObject tag cid: value.
I have got the attachment in webMethods. PFA the SOAP UI screenshot. But i have to use built in service pub.soap.utils:getXOPObjectContent to view the content.
Do you have any other service to view the actual MTOM request received?