简体   繁体   中英

access web services with php

I'm trying to access webservice using php . 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 )

The message you are seeing looks to be coming from the web services side, not yours. Chances are that the PHP Notice that's being thrown is invalidating the XML response. Your best bet is to get in contact with the company and report it as a bug.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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