简体   繁体   English

用php访问Web服务

[英]access web services with php

I'm trying to access webservice using php . 我正在尝试使用php访问webservice I'm calling a method from the services then i get an error . 我从服务中调用方法,然后出现错误。

My code is below,help me sort this.. 我的代码在下面,请帮助我进行排序。

$message = $_REQUEST['message'];
$recipient ="250788353869";//$_REQUEST['recipient'];
$phone=(int)$recipient;
$account="";
$pin="";        
ini_set("soap.wsdl_cache_enabled", "0"); // Set to zero to avoid caching WSDL
$soapClient = new SoapClient('http://gateway.esicia.com?wsdl');     
$result = $soapClient->ksend(array('account'=>$account,'pin'=>$pin,'sender'=>$sender_phone,'message'=>$message,'phone'=>$phone));    
print_r($result);

and error I get on the reply is: 我得到的错误是:

Notice: Array to string conversion in /opt/lampp/htdocs/Admin/sms/smspost.php on line 25 Array ( [reply] => Error Invalid phone - has to be numeric [balance] => [status] => 0 ) 注意:在第25行数组/opt/lampp/htdocs/Admin/sms/smspost.php中,数组到字符串的转换([回复] =>错误无效的电话-必须为数字[余额] => [状态] => 0 )

The message you are seeing looks to be coming from the web services side, not yours. 您看到的消息似乎来自Web服务端,而不是您的。 Chances are that the PHP Notice that's being thrown is invalidating the XML response. 可能的是,抛出的PHP通知使XML响应无效。 Your best bet is to get in contact with the company and report it as a bug. 最好的选择是与公司联系并将其报告为错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM