我们在ASP.Net产品中使用的一种Web服务已发布了新的WSDL。但是他们声称没有功能更改。 由于出现异常,因此我试图比较新旧WSDL。 我看到一些格式“语言”的差异。 这是两种表达Soap WSDL的方式, 还是以下两种不同的模式编写版本?我在网上找不到任何提及。
我仍然是.Net世界的新手! 我是否应该继续简单地在.Net产品中重新创建引用并完成引用?
无论如何,这是一个例外
<?xml version="1.0"?>
<definitions name="ServerPmtPortal" targetNamespace="urn:ServerPmtPortal" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="urn:ServerPmtPortal"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types xmlns="http://schemas.xmlsoap.org/wsdl/"> </types>
<message name="newOrderRequest">
<part name="appID" type="xsd:string" />
<part name="merID" type="xsd:string" />
<part name="redURL" type="xsd:string" />
<part name="uname" type="xsd:string" />
<part name="cmt" type="xsd:string" />
</message>
<message name="newOrderResponse">
<part name="tranID" type="xsd:string" />
</message>
<portType name="ServerPmtPortalPort">
<operation name="newOrder">
<input message="tns:newOrderRequest" />
<output message="tns:newOrderResponse" />
</operation>
</portType>
<binding name="ServerPmtPortalBinding" type="tns:ServerPmtPortalPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="newOrder">
<soap:operation
soapAction="urn:SOAP_PmtPortal_Server#SOAP_PmtPortal_Server#newOrder" />
<input>
<soap:body use="encoded" namespace="urn:SOAP_PmtPortal_Server"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soap:body use="encoded" namespace="urn:SOAP_PmtPortal_Server"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
<service name="ServerPmtPortalService">
<documentation />
<port name="ServerPmtPortalPort" binding="tns:ServerPmtPortalBinding">
<soap:address location="https://www.service.com/paynow/service/server.php" />
</port>
</service>
</definitions>
我包括旧的和新的WSDL(剥离了除一项操作之外的所有内容)
旧的WSDL(有关新的WSDL,请参阅本节后面的内容)
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:ServerPmtPortal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="ServerPmtPortalService"
targetNamespace="urn:ServerPmtPortal">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:ServerPmtPortal" version="1.0">
<xs:element name="newOrderRequest">
<xs:complexType>
<xs:all>
<xs:element name="appID" type="xs:string"/>
<xs:element name="merID" type="xs:string"/>
<xs:element name="redURL" type="xs:string"/>
<xs:element minOccurs="0" name="uname" type="xs:string"/>
<xs:element minOccurs="0" name="cmt" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="newOrderResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="tranID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="newOrder">
<wsdl:part element="tns:newOrderRequest" name="body">
</wsdl:part>
</wsdl:message>
<wsdl:message name="newOrderResponse">
<wsdl:part element="tns:newOrderResponse" name="body">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="ServerPmtPortalPort">
<wsdl:operation name="newOrder">
<wsdl:input message="tns:newOrder" name="newOrder">
</wsdl:input>
<wsdl:output message="tns:newOrderResponse" name="newOrderResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServerPmtPortalServiceSoapBinding" type="tns:ServerPmtPortalPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="newOrder">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="newOrder">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="newOrderResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ServerPmtPortalService">
<wsdl:port binding="tns:ServerPmtPortalServiceSoapBinding" name="ServerPmtPortalPort">
<soap:address location="https://stage.service.com/Pmt-proxy/services/v1/paynow"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
NEW WSDL就是这样
{{1}}
答案 0 :(得分:0)
我不知道如何理解WSDL定义中的差异。 从生成客户端或存根代码的方式来看,旧WSDL的newOrder方法采用5个单独的参数:appID,merID,redURL,uname,cmt。 新的WSDL方法仅采用一个参数,即newOrderRequest,而该参数又包含5个属性。 我生成并使用了新的存根,并告诉相关人员,如果不更改代码,我们将无法指向新的WSDL。