SOAP API的版本不匹配

SOAP API的版本不匹配,soap,soap-client,Soap,Soap Client,我通过以下请求从postman调用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<

我通过以下请求从postman调用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>

2.
但是,它给出了以下回应

<?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>

S:版本匹配
无法创建SOAP消息。命名空间中应为信封http://schemas.xmlsoap.org/soap/envelope/,但是

有人能帮帮我吗,我做错了什么。

您的Soap信封名称空间不正确,您的请求应该是这样的--


2.

是的,我刚刚解决了这个问题。这是一个名称空间问题。但是,与你在这里给出的有点不同。感谢you@amit,我也面临同样的问题,你是如何解决这个问题的?@suneha我建议你使用IDE或chrome插件从wsdl生成soap请求。因为,在我的例子中,这是名称空间问题,我希望像另一个例子一样,但它略有不同。所以,请解析wsdl,您将得到正确的wsdl。
<?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>