Search code examples
web-serviceswcfsoapwsdl

WCF using soap 1.2 generates wsdl with soap 1.1 reference


I am creating a WCF service which must have a soap 1.2 endpoint. The service is using the following custom binding:

    <customBinding>
        <binding name="httpsBinding" openTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" receiveTimeout="00:10:00">
          <transactionFlow />
          <security authenticationMode="UserNameOverTransport" allowInsecureTransport="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" >
            <secureConversationBootstrap allowInsecureTransport="true"></secureConversationBootstrap>
          </security>
          <textMessageEncoding messageVersion="Soap12">
            <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
                maxBytesPerRead="2147483647"
                maxNameTableCharCount="2147483647" />
          </textMessageEncoding>
          <httpsTransport maxReceivedMessageSize="2147483647"  />
        </binding>
      </customBinding>

All right until here, the packages are in the right format (soap 1.2) when debugged via fiddler:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header>...

But investigating the WSDL generated, the binding seems to be referring the soap 1.1 schema.

<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>

There is no reference for http://www.w3.org/2003/05/soap-envelope on the WSDL. Though it's working, I guess there is something wrong since the WSDL seems not to be describing the service correctly.


Solution

  • Try making the below changes in web.config (OR) app.config file

    <Configuration>
        <webServices>
            <protocols>
                <remove name="HttpSOAP"/>
                <add name="HttpSOAP12" />
            </protocols>
        </webServices>
    </configuration>