How to insert attachment on webservice

Hi,

I’m trying to insert an attachment on my webservice, but i’m having problems.

My webservice receives two strings normally, and needs to receive an attachment too, but I don’t know how to do.

Anyone knows how to do that?

Thanks!

pls read the “Web Services Developer’s Guide” for how to use attachment in WS.

I already read this guide, and the attachments are enabled, but I can’t put the attachment inside the flow like an input/output data, and the guide don’t say nothing about it.

did you read chapter 7 MTOM Streaming
section: Using MTOM Streaming for Service First Provider Web Service Descriptors
it’s pretty clear how to use it.

Well, i think our guide are different. I’m reading Web Services Developer’s Guide - Version 8.0 - December 2009 and I don’t have this chapter.

This is weird!

for that version of IS, there is already support of MTOM.
in chapter 5, “Enabling MTOM/XOP Support for a Web Service Descriptor”
With newer version of IS, it’s much easier to do the same

I followed the steps and the attachments are enabled… Alright.

But I can’t put the attachment like a data, to when the user start the service, he can insert an attachment, like pdf.

Hi All,

I have a similar requirement , and i to followed the same steps as mentioned in the guide.But i’m not sure how to test it .How to pass the data and what type of input should be set to to handle the attachment.
Please let me know on how to implement this.

Thanks and Regards,
Raj

When MTOM is enabled for a webservice the Base64 encoded object will be visible as NULL.
if you want to test the attachment then you need to convert the file using “pub.soap.utils:getXOPObjectContent” service and then save it to filesystem.

Hi all,

The MTOM Streaming topic is also discussed here: Issue with pub.soap.utils:getXOPObjectContent ..... MTOM objects - webMethods - Software AG Tech Community & Forums, where you can find attached a sample.

Although MTOM is not a must when creating web services that receive attachments, it is very useful if this attachments are rather big.

For testing you can use:

  • SoapUI to call your web service
  • Wireshark or other sniffing tool to monitor the way the content was sent

You can find a very nice explanation on how MTOM works here: w3c - How does MTOM work? - Stack Overflow

Hope it helps,
Vlad Turian

I agree with Vlad Turian comments.

Raj & Luis, please use search option to know more on this.

Thanks,