WS with attachment

My requirement is ,will receive the attachment through WS and send to target system.

I created a flow service to receive the attachment data .

      1. pub.string:base64Decode              
      2. pub.string:bytesToString

I created provider of that service with attachment enabled ‘true’. below are the flow service steps

tested the WSDL in SOAP UI with enable MTOM property ‘true’ and received the encoded data in my flow service.

Below was the request structure used in SOAP UI.

soap:Header/
soap:Body
bip:receiveAttachment
cid:TN_xml.xml
</bip:receiveAttachment>
</soap:Body>
</soap:Envelope>

But If I create connector of that WSDL , Please let me know how I can send a file as attachment from webMethod.
And also suggest whether above approach is correct or not to receive the attachment.

Biplab – There are a couple of threads in techCommunity, can you search and get the answer. If you come across any issues please share.

Thanks,

There can be multiple scenario’s here for your request.

I will Explain one of them.

Lets consider your pass an input string ‘x’ from Soap Ui and you want to receive an XOP object as output.

output field type should be set as XOPObject.
GetFile from filesystem/Db as per your requirement. (random example)
Create a XOPObject using inbuild service. (pub.soap.utils:createXOPObject)
Create a Soap1.2 Provider.
Set “Attachment enabled” property as true in Soap provider.
Consume in Soap UI and enable attachment in Soap UI Properties.

Done.

Regards,
Syed Faraz Ahmed