Forum Discussion

stamhaney's avatar
stamhaney
New Contributor
7 years ago

Add MTOM using SoapUi opensource

Hi All,
I am using soapui open source to add an attachment (MTOM enabled) to an operation and invoke the web service using java. When I execute the code, i get the message:

Receiving response: HTTP/1.1 415 Cannot process the message because the content type 'multipart/related; type="application/xop+xml";....

The same request when sent through the SoapUI UI interface, gives me a proper response.

The code I am using to add the attachment is:

WsdlRequest req = op.addNewRequest("Req1");
req.setRequestContent(op.createRequest(true));
File fileToAttach = new File("c:\\tmp\\Test1.txt");
req.attachFile(fileToAttach, true);
req.setMtomEnabled(true);

I have also noticed that though the Content Type of the wsdl request is text/xml the response of the web service, when captured in fiddler, shows Content Type as multipart/related after the request is submitted, using request.submit.


Do I have to call any other method for getting a proper response? Can you please let me know where am I going wrong?

Thank you
Shashank
No RepliesBe the first to reply