Forum Discussion

hastikeyvan's avatar
hastikeyvan
New Contributor
9 years ago

don't get attachment while sending mtom message with wcf in soapUI

I'm implementing a service which receives some string as request and should return back a pdf file in mtom attachment format. When I test it on my own machine with the client forms I can read the data from the content of message but when I checked the output in SOAPUI I found that the message is not sending in mtom format and is sending message in inline format . The raw view of the out put is as follows:

HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 1252359
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
Set-Cookie: ASP.NET_SessionId=itqdxvdxyovixbj1iglyy5n0; path=/; HttpOnly
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 20 Jan 2016 13:13:58 GMT

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><GetMaintenanceProtocolPdfAttachmentResponse xmlns="http://xmlns.scania.com/maintenance/schema/technicalinformationmsgs/v1"><GetMaintenanceProtocolPdfAttachmentResult>JVBERi0xLjQNCiXi48/TDQo

 How can I activate mtom to get the attachment in the output? ( I changed the messageEncoding to Mtom but doesn't work I think)

  • hastikeyvan's avatar
    hastikeyvan
    New Contributor

    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.

     
     
    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)