cancel
Showing results for 
Search instead for 
Did you mean: 

Add MTOM Attachment using SoapUI

New Contributor

Add MTOM Attachment using SoapUI

Hi,
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);

 

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

 

2 REPLIES 2
Super Contributor

Re: Add MTOM Attachment using SoapUI

Is the issue when you try to add attachment using java code?

to me it seems like SOAP UI has no issues and this is more less a problem when you trying to use Java.

I am sure stackoverflow may have some answers to this. 

New Contributor

Re: Add MTOM Attachment using SoapUI

Yes, it happens when I use java and soapui programatically. The same request xml works fine in the UI. I have also noticed that though the Content Type of the 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
New Here?
Join us and watch the welcome video:
API Testing Mistake #2
APITestingMistake#2
Top Kudoed Authors