sirclaudio
14 years agoNew Contributor
MTOM and soap 1.2 .net service -> Bad Request
I'm trying to invoke a .net web service with soap 1.2, WS-A and MTOM using SoapUI 3.5.1 and 3.6 open source, but the answer is always 400 - Bad Request.
Looking at the exception thrown, .net is complaining about the type that is in the content-type of the root mime part, that received "application/soap+xml; action=\"SendFile\"", but expected "application/soap+xml" - i wanted to put here the right message, but i'tm at a different pc right now and the error that appears now is "MTOM messages must have type 'application/xop+xml'.", looking at the message, it really is quite different from the others.
Using a .net client, the type has only "application/soap+xml", both in the root mime part and in the message header, in the start-info tag. In the message sent by soapui, that tag has "application/soap+xml" and the type of the root mime part has "application/soap+xml; action=\"SendFile\"", which may be what is causing this.
Looking at the W3C http://www.w3.org/TR/2005/REC-xop10-20050125/#mime_xop_packages, i think that start-info must contain the same value as the type parameter of the root mime part.
Can you look into this?
Here is the message from the http log.
Looking at the exception thrown, .net is complaining about the type that is in the content-type of the root mime part, that received "application/soap+xml; action=\"SendFile\"", but expected "application/soap+xml" - i wanted to put here the right message, but i'tm at a different pc right now and the error that appears now is "MTOM messages must have type 'application/xop+xml'.", looking at the message, it really is quite different from the others.
Using a .net client, the type has only "application/soap+xml", both in the root mime part and in the message header, in the start-info tag. In the message sent by soapui, that tag has "application/soap+xml" and the type of the root mime part has "application/soap+xml; action=\"SendFile\"", which may be what is causing this.
Looking at the W3C http://www.w3.org/TR/2005/REC-xop10-20050125/#mime_xop_packages, i think that start-info must contain the same value as the type parameter of the root mime part.
Can you look into this?
Here is the message from the http log.
POST ############## HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="application/xop+xml"; start="<rootpart@soapui.org>"; start-info="application/soap+xml"; action="SendFile"; boundary="----=_Part_10_7396679.1285664994648"
MIME-Version: 1.0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: ##########
Content-Length: 3830
------=_Part_10_7396679.1285664994648
Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml; action=\"SendFile\""
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart@soapui.org>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="########" xmlns:mtom="http://schemas.datacontract.org/2004/07/MtomService">
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>SendFile</wsa:Action><wsa:To>###########################</wsa:To></soap:Header>
<soap:Body>
<urn:SendFile>
<urn:sendInput>
<mtom:CorrelationID>96</mtom:CorrelationID>
<mtom:OperationID>23</mtom:OperationID>
<mtom:BusinessProcessID>24</mtom:BusinessProcessID>
<mtom:RequiresDeliveryConfirmation>true</mtom:RequiresDeliveryConfirmation>
<mtom:RequiresTransmissionSecurity>false</mtom:RequiresTransmissionSecurity>
<mtom:IncludesAttachment>true</mtom:IncludesAttachment>
<mtom:Attachment><inc:Include href="cid:file.zip" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></mtom:Attachment>
<mtom:FileFormat>zip</mtom:FileFormat>
</urn:sendInput>
</urn:SendFile>
</soap:Body>
</soap:Envelope>
------=_Part_10_7396679.1285664994648
Content-Type: application/zip; name=file.zip
Content-Transfer-Encoding: binary
Content-ID: <file.zip>
Content-Disposition: attachment; name="file.zip"; filename="file.zip"
### binary data ###
------=_Part_10_7396679.1285664994648--