我收到了一个 WSDL,其中包含 SOAP 1.1 和 SOAP 1.2 的参考,因为服务器同时支持 SOAP 1.1 和 1.2
但是,我想将 SOAP 1.2 用于我的客户目的。但是当我尝试使用 Visual Studio 生成服务引用时,它只会生成 1.1 的引用。有没有办法强制生成 1.2 参考?
以下是我收到的 wsdl:
<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>