WCF using soap 1.2 generates wsdl with soap 1.1 reference

11,510

Solution 1

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

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

Solution 2

<Configuration>
 <system.web>
   <webServices>
     <protocols>
        <remove name="HttpSOAP"/>
        <add name="HttpSOAP12"/>
     </protocols>
  </webServices>
</system.web>

websServices needs to be enclosed within the system.web section. If not the soltuion throws error " The configuration section 'webServices' cannot be read because it is missing a section declaration "

Share:
11,510
Sérgio S. Filho
Author by

Sérgio S. Filho

Analista fullstack na empresa Intcom

Updated on June 05, 2022

Comments

  • Sérgio S. Filho
    Sérgio S. Filho almost 2 years

    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.

  • Sérgio S. Filho
    Sérgio S. Filho about 10 years
    Thanks @Rahul, now the namespace for soap12 is explicit: xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" though Im still confused about the line: <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
  • Sérgio S. Filho
    Sérgio S. Filho about 10 years