在 PHP 中设置 SOAP 参数
我真的是 SOAP 新手,所以请帮助我设置发送请求的参数:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ManagedSoapHeader xmlns="http://tempuri.org/">
<_SID>string</_SID>
</ManagedSoapHeader>
</soap:Header>
<soap:Body>
<GetSessionParameters xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
这是我的代码
$client->getInfo(array("Header" => array("ManagedSoapHeader" => array("_SID" => $sessionID)))); //->ManagedSoapHeader(array("_SID" => $sessionID));
但是我在服务器上设置类时遇到了致命错误...不知道这一点...所以我的问题:
如何设置_SID?
I am realy new whis SOAP, so please help me to set parameters for sending a request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ManagedSoapHeader xmlns="http://tempuri.org/">
<_SID>string</_SID>
</ManagedSoapHeader>
</soap:Header>
<soap:Body>
<GetSessionParameters xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
this is my code
$client->getInfo(array("Header" => array("ManagedSoapHeader" => array("_SID" => $sessionID)))); //->ManagedSoapHeader(array("_SID" => $sessionID));
But I getting an fatal error about setting a class on server... no idea about this... so my question:
How to set _SID?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不太确定您正在使用哪个库,但您可能有兴趣阅读 PHP 5 中已包含的 SOAP 客户端
。 Soapclient.php" rel="nofollow">http://www.php.net/manual/en/soapclient.soapclient.php
例如,要使用 PHP SoapClient 设置 SOAP 参数,您只需为此:
您可以还想研究其他第三方客户端,例如 NuSOAP,它是对本机 PHP 客户端的改进。
http://sourceforge.net/projects/nusoap/
I'm not really sure what library you are using but you may be interested in reading the SOAP Client that is already included with PHP 5.
http://www.php.net/manual/en/soapclient.soapclient.php
For instance, to set the parameters for SOAP using the PHP SoapClient you would simply need to do this:
You may also want to research other third party clients such as NuSOAP which is meant to be an improvement on the native PHP client.
http://sourceforge.net/projects/nusoap/
尝试使用 http://php.net/manual/en/soapclient.setsoapheaders.php< /a> 类似
最后,为什么要调用
$client->getInfo(...)
?在 SOAP Body 中,我看到您只有GetSessionParameters
操作。恕我直言,你应该打电话Try to use http://php.net/manual/en/soapclient.setsoapheaders.php Something like
Finally, why do you call
$client->getInfo(...)
? In the SOAP Body I see you have justGetSessionParameters
operation. IMHO you should call