Forum Discussion

maddzy's avatar
maddzy
Occasional Contributor
9 years ago

Sending a request as "multipart/related"

Hi,

 

I have a requirement to send a multipart SOAP message, with attachment, to a HTTP endpoint as POST.

 

The endpoint I am sending to requires I use the multipart/related Content-Type header (as per https://www.w3.org/TR/SOAP-attachments)

 

The headers created by SoapUI  are 

POST http://localhost:8280/dri HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/form-data; boundary="----=_Part_13_1478701338.1472550054487"
MIME-Version: 1.0
Content-Transfer-Encoding: binary
Content-Length: 4534
Host: localhost:8280
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

And this throws an error, because SOAPMessage (http://docs.oracle.com/javaee/5/api/javax/xml/soap/SOAPMessage.html)  requires the header to be multipart/related in order to parse the message.

 

So I require SoapUI to either allow me to use multipart/related or allow me to manually edit the Content-Type header after the request has been created (changing multipart/form-data to multipart/related is all I need to change)

 

Is there any help or workaround you can offer me?

 

Thanks & Regards,

Dave