SOAP 的版本不匹配 API
Version mismatch from SOAP API
我正在从邮递员处调用 SOAP API 并提出以下请求。
<?xml version="2.0" ?>
<Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<get xmlns:S="http://xml.abc.com/cde/2.xsd" xmlns:S="http://ws.abc.com/cde.2">
<sid>2</sid>
</get>
</Body>
</Envelope>
但是,它给出了以下响应。
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:VersionMismatch</faultcode>
<faultstring>Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got </faultstring>
</S:Fault>
</S:Body>
</S:Envelope>
谁能帮帮我,我做错了什么。
您的 Soap Envelope 命名空间不正确,您的请求应该类似于--
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<ns1:get xmlns:ns1="http://ws.abc.com/cde.2">
<ns1:sid>2</ns1:sid>
</ns1:get>
</soap:Body>
</soap:Envelope>
与SOAP版本有关。 SOAP 1.2 使用 http://www.w3.org/2003/05/soap-envelope for the namespace and SOAP 1.1 uses http://schemas.xmlsoap.org/soap/envelope/.
有关参考,请参阅 http://www.w3.org/TR/soap/ 并查看不同版本规范中的信封部分。
我正在从邮递员处调用 SOAP API 并提出以下请求。
<?xml version="2.0" ?>
<Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<get xmlns:S="http://xml.abc.com/cde/2.xsd" xmlns:S="http://ws.abc.com/cde.2">
<sid>2</sid>
</get>
</Body>
</Envelope>
但是,它给出了以下响应。
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:VersionMismatch</faultcode>
<faultstring>Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got </faultstring>
</S:Fault>
</S:Body>
</S:Envelope>
谁能帮帮我,我做错了什么。
您的 Soap Envelope 命名空间不正确,您的请求应该类似于--
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<ns1:get xmlns:ns1="http://ws.abc.com/cde.2">
<ns1:sid>2</ns1:sid>
</ns1:get>
</soap:Body>
</soap:Envelope>
与SOAP版本有关。 SOAP 1.2 使用 http://www.w3.org/2003/05/soap-envelope for the namespace and SOAP 1.1 uses http://schemas.xmlsoap.org/soap/envelope/.
有关参考,请参阅 http://www.w3.org/TR/soap/ 并查看不同版本规范中的信封部分。