我一直在嘗試解決此錯誤,但我已經用完了想法。我使用自己的WCF服務調用SOAP webservice,但發生以下CommunicationException:SOAP錯誤無效;以限定名稱使用的未綁定前綴
服務器返回無效的SOAP錯誤。有關更多詳細信息,請參閱InnerException。
和內部(XmlException):
合格的名稱中使用未綁定前綴 'soapenv:服務器'。
因此,爲了更好地理解它我使用SOAP UI看,我得到它的迴應如下:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pbs="REDACTED" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>REDACTED</faultstring>
<detail>
REDACTED
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
據我所知,它是與在faultcode,但我不完全確定它是什麼。我知道我期望一個FaultException而不是一個通信異常。我想對此作出反應的錯誤的詳細信息中包含一些信息,但此例外隱藏了我的信息。
編輯:
這是他們收到的主機上的要求(從我的web發送):
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<setREDACTED xmlns="REDACTED" >
<infotag>info</infotag>
</setREDACTED>
</s:Body>
</s:Envelope>
這一點,一個我從SOAPUI派:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pbs="REDACTED" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header/>
<soapenv:Body>
<pbs:setREDACTED>
<infotag>info<infotag>
</pbs:setREDACTED>
</soapenv:Body>
</soapenv:Envelope>
問題是的faultcode「soapenv.Server」 ...它與xml命名空間xmlns相匹配:soapenv =「http://schemas.xmlsoap.org/soap/envelope/」這在某種程度上會導致解析問題......您能否將服務端的故障代碼更改爲其他內容? – Viru
我無法更改回復,因爲我沒有擁有該服務。 – evilfish
但是那個有效的故障碼?可能是你必須與服務負責人覈實並糾正錯誤......我不認爲有任何其他方法...... – Viru