WCF Service reference generates code for SOAP 1.1, not for SOAP1.2

691 Views Asked by At

I've received a WSDL which contains the reference for both SOAP 1.1 & SOAP 1.2, since the server supports both SOAP 1.1 & 1.2

However, I would like to use SOAP 1.2 for my client purpose. But when I try to generate the Service reference using Visual Studio, it generates the reference for only 1.1. Is there a way to force generation of 1.2 reference?

Following is the wsdl which I have received:

<wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
      <s:element name="MyTestInfo">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="SirName" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="MyTestInfoResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="MyTestInfoResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="MyTestInfoSoapIn">
    <wsdl:part name="parameters" element="tns:MyTestInfo" />
  </wsdl:message>
  <wsdl:message name="MyTestInfoSoapOut">
    <wsdl:part name="parameters" element="tns:MyTestInfoResponse" />
  </wsdl:message>
  <wsdl:portType name="MyTestSoap">
    <wsdl:operation name="MyTestInfo">
      <wsdl:input message="tns:MyTestInfoSoapIn" />
      <wsdl:output message="tns:MyTestInfoSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="MyTestSoap" type="tns:MyTestSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="MyTestInfo">
      <soap:operation soapAction="http://tempuri.org/MyTestInfo" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="MyTestSoap12" type="tns:MyTestSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="MyTestInfo">
      <soap12:operation soapAction="http://tempuri.org/MyTestInfo" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="MyTest">
    <wsdl:port name="MyTestSoap" binding="tns:MyTestSoap">
      <soap:address location="http://testServer.com/MyTest.asmx" />
    </wsdl:port>
    <wsdl:port name="MyTestSoap12" binding="tns:MyTestSoap12">
      <soap12:address location="http://testServer/MyTest.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
0

There are 0 best solutions below