php 使用带有不同 SoapAction 的 SOAP

发布于 2024-12-17 23:18:07 字数 287 浏览 1 评论 0原文

我正在使用一个 WSDL,它的标头中的 SOAP 操作与我期望的不同。当我调用 Web 服务时,我就像是一个 Web 服务的 .NET 描述站点。在本例中,

https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx

我实际上应该调用什么 URL 来获取 getPurseBalance() 方法,因为 WSDL 的 SOAP 操作中的选项似乎没有定义,我是否可以确定这一点,或者我应该访问 Web服务提供商?

谢谢,

I'm working with a WSDL that has a different SOAP Action in the header to the one I would expect. At the moment when I call the web service, I just get like a .NET description site of a web service. In this instance it's

https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx

What URL should I actually call to get to the getPurseBalance() method as the option in the SOAP Action from the WSDL doesn't seem to be defined, is there anyway I can determine this or should I go to the web service provider?

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

哭了丶谁疼 2024-12-24 23:18:08

看到这个 http://www.php.net/manual/en/soapclient.setlocation .php

我认为你应该使用

$client->__setLocation('https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx');

see this http://www.php.net/manual/en/soapclient.setlocation.php

I think you should use

$client->__setLocation('https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx');
君勿笑 2024-12-24 23:18:07

您不应该调用 URL,您应该将 XML 发布到该直接同一页面。要了解要发送到网络服务的内容,您可以检查您的 URL:

https: //preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx?op=getPurseBalance

在这里您还可以查看您的 SoapAction 和其他要发送的标头:

POST /ytm/sQuidpages/sQuidPWS.asmx HTTP/1.1
Host: preprod.squidcard.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://secure.squidcard.com/getPurseBalance"

如果您不想手动创建 XML,您还可以使用 PHP 中的 SoapClient 类。您可以在此处找到更多信息:

http://www.php.net/manual/ en/class.soapclient.php

$client = new SoapClient("https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx?WSDL");
var_dump($client->__getFunctions());

$client->__soapCall("getPurseBalance", array('your parameters'));

You should not call a URL, you should post a XML to this direct same page. To know what to send to the web service you can check your URL:

https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx?op=getPurseBalance

Here you can also view your SoapAction and other headers to be send:

POST /ytm/sQuidpages/sQuidPWS.asmx HTTP/1.1
Host: preprod.squidcard.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://secure.squidcard.com/getPurseBalance"

If you don't want to create XML manually you can also use the SoapClient class from PHP. You can find more information here:

http://www.php.net/manual/en/class.soapclient.php

$client = new SoapClient("https://preprod.squidcard.com/ytm/sQuidpages/sQuidPWS.asmx?WSDL");
var_dump($client->__getFunctions());

$client->__soapCall("getPurseBalance", array('your parameters'));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文