php 如何确定有效的 SoapAction?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/128263/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 21:34:45  来源:igfitidea点击:

How do you determine a valid SoapAction?

phpweb-servicessoap

提问by Craig Vermeer

I'm calling a webserviceusing the NuSoap PHP library. The webserviceappears 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 SoapActionthat the server is expecting?

我正在webservice使用NuSoap PHP library. 在webservice出现使用.NET; 每次我调用它时,我都会收到关于使用无效SoapAction header. 发送的标头是一个空字符串。我怎样才能找到SoapAction服务器期望的?

回答by Craig Vermeer

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,您可以看到您正在调用的服务操作期望的 SoapAction。对于 .NET 服务,您可以通过将 Web 浏览器打开到服务的 url 并在末尾附加 ?wsdl 来访问 WSDL。

Inside the WSDL document, you can see the SoapActions defined under the 'Operation' nodes (under 'Bindings'). For example:

在 WSDL 文档中,您可以看到在“操作”节点下(在“绑定”下)定义的 SoapActions。例如:

<wsdl:operation name="Execute">
  <soap:operation soapAction="http://tempuri.org/Execute" style="document" />

Find the operation node for the operation you're trying to invoke, and you'll find the Soap Action it expects there.

找到您尝试调用的操作的操作节点,您将在那里找到它期望的 Soap Action。