0

I'm new to Mtom topic. I try to build an Mtom message with attachment in response while my request is string. I tested it with SOAPUI but the resnpose is not in Mtom format and is like inline message:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetMaintenanceProtocolPdfAttachmentResponse  xmlns="http://schemafileaddress">
<GetMaintenanceProtocolPdfAttachmentResult>
</GetMaintenanceProtocolPdfAttachmentResponse>
</s:Body>
<a:Titles>MAI_PRINT_164341883_1.pdf</a:Titles>
<a:file>JVBERi0xLjQNCiXi48/TDQoxIDAg</a:file>
</s:Envelope>

The raw view of SOAPUI response is as follows:

TTP/1.1 200 OK
Cache-Control: private
Content-Length: 1265591
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=435hj33ut2nusjpt1rjtrg5c; path=/; HttpOnly
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 19 Jan 2016 10:26:06 GMT


<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetMaintenanceProtocolPdfAttachmentResponse xmlns="http://schemaAddres">
<GetMaintenanceProtocolPdfAttachmentResult  xmlns:a="http://schemaAddres" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Titles>MAI_PRINT_112605460_1.pdf</a:Titles>
<a:file>JVBERi0xLjQNCiXi48</a:file>

I tried this but couldn't get the desired result. I would be grateful if anyone could help me to fix the problem.

Matt
  • 14,906
  • 27
  • 99
  • 149
  • I searched about the reason that I get inline response and found that I'm using basicHttpBinding which will produce inline response. I changed my wsdl file from SOAP1 to SOPA1.2 to convert the binding from to wsHttp ( Also I defined wsHttp in web.config). But when I run wsdl file with svcutil.exe I get CustomBinding in the output.config file instead of wsHttpBinding. – Hasti Keyvan Jan 25 '16 at 11:46
  • Can anyone provide a solution to make wsHttpBinding in output.config by changing WSDL. (I found that if we set the protectionlevel to none or sign then we will have customBinding). But couldn't find any source that describing how change the protectionLevel in WSDL file ( even I'm not sure if we can change it in WSDL) – Hasti Keyvan Jan 25 '16 at 11:47
  • I continued with custom binding and defined it in my web.config : ' ' – Hasti Keyvan Jan 26 '16 at 13:14
  • Also my outputconfig is: ' ' But I get client and service type mismatch – Hasti Keyvan Jan 26 '16 at 13:16

0 Answers0