SOAP server 1.1 sending response using content type defined for 1.2?

  • I tried sending a SOAP1.2 request to a server and received following exception

    System.ServiceModel.CommunicationException: The envelope version of the incoming message (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)) does not match that of the encoder (Soap12 (http://www.w3.org/2003/05/soap-envelope)). Make sure the binding is configured with the same version as the expected messages.

  • On analyzing the traffic through wireshark, I see the response envelope as http://schemas.xmlsoap.org/soap/envelope/ and request envelope as http://www.w3.org/2003/05/soap-envelope

  • Again I tried sending message to same server using SOAP 1.1 and got following exception

    System.ServiceModel.ProtocolException: The content type application/soap +xml of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.

  • Based on above 2 logs, can I conclude the remote server is using SOAP1.1 and sending the response using content type defined for SOAP1.2 which is application/soap+xml? Is it the right implementation of SOAP specification?

    Code was generated using Service reference from WSDL. Following is the code snippet:

    Test3.ServiceReference1.SoapRqst client = new Test3.ServiceReference1.SoapRqstClient();
    RepRequest rqst = new RepRequest();
    RepResponse op = client.getReply(rqst);
    string responseSting = op.Body.respMsg;
    Console.Out.Write(responseSting);
    

    Client side service model:

    Service binding For SOAP 1.1

       <system.serviceModel>
       <bindings>
            <basicHttpBinding>
                <binding name="<>"  />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="<>"
                binding="basicHttpBinding" bindingConfiguration="<>"
                contract="<>" name="<>" />
        </client>
    </system.serviceModel>
    



    Service binding for SOAP 1.2

       <system.serviceModel>
        <bindings>
        <customBinding>
            <binding name="">
                <textMessageEncoding messageVersion="Soap12" />
                <httpTransport />
            </binding>
        </customBinding>
    </bindings>
    <client>
        <endpoint address="<>"
            binding="customBinding" bindingConfiguration="<>"
            contract="<>" name="<>" />
    </client>
    

    链接地址: http://www.djcxy.com/p/35310.html

    上一篇: SOAP请求使用nodejs

    下一篇: SOAP服务器1.1使用为1.2定义的内容类型发送响应?