問題描述
我正在使用 NuSoap PHP 庫
調(diào)用一個 webservice
.webservice
似乎使用 .NET
;每次我調(diào)用它時,都會收到關(guān)于使用無效 SoapAction 標(biāo)頭
的錯誤.發(fā)送的標(biāo)頭是一個空字符串.如何找到服務(wù)器期望的 SoapAction
?
I'm calling a webservice
using the NuSoap PHP library
. The webservice
appears to use .NET
; every time I call it I get an error about using an invalid SoapAction header
. The header being sent is an empty string. How can I find the SoapAction
that the server is expecting?
推薦答案
通過查看服務(wù)的 WSDL,您可以看到您正在調(diào)用的服務(wù)操作期望的 SoapAction.對于 .NET 服務(wù),您可以通過在 Web 瀏覽器中打開服務(wù)的 URL 并在末尾附加 ?wsdl 來訪問 WSDL.
You can see the SoapAction that the service operation you're calling expects by looking at the WSDL for the service. For .NET services, you can access the WSDL by opening a web browser to the url of the service and appending ?wsdl on the end.
在 WSDL 文檔中,您可以看到在操作"節(jié)點下(在綁定"下)定義的 SoapActions.例如:
Inside the WSDL document, you can see the SoapActions defined under the 'Operation' nodes (under 'Bindings'). For example:
<wsdl:operation name="Execute">
<soap:operation soapAction="http://tempuri.org/Execute" style="document" />
找到您嘗試調(diào)用的操作的操作節(jié)點,您會在那里找到它期望的 Soap Action.
Find the operation node for the operation you're trying to invoke, and you'll find the Soap Action it expects there.
這篇關(guān)于如何確定有效的 SoapAction?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!