php调用webservice
php调用webservice的方法
try{
$client = new SoapClient("http://127.0.0.1:8888/xx/xx?wsdl"); $param = array('arg0' => 'test','arg1' => $result,'arg2' => null); $p = $client->__soapCall('login', array('parameters' => $param));
}catch(Exception $e){
printf('message:'.$e);
}
可能报错: SoapFault exception: [soap:Server] Fault occurred while processing. in D:\wamp\www\zlx\wentong.php:26
Stack trace:
0 D:\wamp\www\1.php(26): SoapClient->__soapCall('login', Array)
1 {main}
PS:出现这种错误的原因极有可能就是参数的问题。所以一定要清楚的看好参数,不然,可能因为这个会走好几天弯路。