如何用 PHP 编写 SOAP 客户端?
需要在 php 中为 SOAP 客户端提供简单的代码/建议
示例请求
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:sch="http://somewebsite.com/Publisher/schemas">
<soapenv:Header/>
<soapenv:Body>
<sch:GetCampaignsRequest>
<sch:username>myusername</sch:username>
<sch:password>mypassword</sch:password>
<sch:approvaltype>approved</sch:approvaltype>
</sch:GetCampaignsRequest>
</soapenv:Body>
</soapenv:Envelope>
我尝试使用下面的 php 代码,但收到错误
致命错误:E:\xampp\ 中超出了最大执行时间 60 秒htdocs\soap\test.php 第 0 行
$params = array('username' => 'username','password' => 'password','approvaltype'=>'approved');
$client=new SoapClient('http://somewebsite.com/Publisher.v1.1/publisher.wsdl', array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));
$result = $client->GetCampaignsRequest($params);
print_r($result);
Need simple code/ suggestion for SOAP client in php
Sample Request
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:sch="http://somewebsite.com/Publisher/schemas">
<soapenv:Header/>
<soapenv:Body>
<sch:GetCampaignsRequest>
<sch:username>myusername</sch:username>
<sch:password>mypassword</sch:password>
<sch:approvaltype>approved</sch:approvaltype>
</sch:GetCampaignsRequest>
</soapenv:Body>
</soapenv:Envelope>
I have try with below php code but I am getting error
Fatal error: Maximum execution time of 60 seconds exceeded in E:\xampp\htdocs\soap\test.php on line 0
$params = array('username' => 'username','password' => 'password','approvaltype'=>'approved');
$client=new SoapClient('http://somewebsite.com/Publisher.v1.1/publisher.wsdl', array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));
$result = $client->GetCampaignsRequest($params);
print_r($result);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试设置更高的执行超时(或无)。
You can try to set a higher execution timeout (or none).