webMethods service has to send some xml message as a content along with MTOM attachment ( .cif/.pdf/.csv file) through http post.
Am using below steps to send the attachment but subscription client didn’t receives any attachments.
Trying to create:mime.
Tyring to convert the files (( .cif/.pdf/.csv file)) to stream.
Adding it to the BodyPart.
Converting “xml” to stream
Adding it to the bodypart.
Creating the mime envelope
Passing the mime envelope to mimestream. in (pub.Client.http)
But couldn’t able to get the attachment in subscription side. Please let me know ways to achieve it
Thanks in advance,
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.
Thank you Prasad for taking your time to reply:)
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.
Thank you so much for you help:)
Did you try smtp which supports attachments ? Is your client supports it ?
Can you please let me know how to read the attachment data in flow service?
I am using SOAP UI to test the service. And i am attaching the attachments in using attachment tab.
Please look into the screenshot. Can you please suggest on this.
Are you receiving via WS-SOAP request ie MTOM based?
put the following two lines at top of your flowservice:
When you have invoked the service once, disable the savePipeline and debug the service in Designer.
By doing so you will find out how the attachment is represented in the flow service.
I could not see the attachment in file.
Can you please let me know how to implement MTOM attachment.
Do you have WmMtomStreamingSample package available in your environment so you get some idea for implementing?
I dont have the WmMtomStreamingSample package in the server.
Can you please advice how to get this.
Please use the cid: 887989226097 in the property panel, currently its value is Test inp…
As per the documentation also:-
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.
Below is the same request structure.
Content-Type: application/xop+xml; charset=UTF-8; type=“text/xml”
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:san=“http://euzdsag001/Sandbox.Jacob.DaimlerNMF.AttachmentPOC”>
<inc:Include href=“cid:http://www.soapui.org/12363165705270” xmlns:inc=“http://www.w3.org/2004/08/xop/include”/>
Please check attachment as well…
Can you suggest any idea how to capture the request in webMethods?
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?
The issue resolved. Please refer web services developers guide. All the information is present in it.
Thanks for updating the final closing info back in this thread!!