php soap客户端调试实例及调试
1,实例
try {$client = new SoapClient(null, array('location' =>'http://localhost/oms07/index.php?r=api', 'uri' =>'http://localhost/oms07'));$results = $client->__soapCall('getFailParts', array('startTime'=>'2011-10-24','endTime'=>'2011-10-25'));var_dump($result);} catch (Exception $e) {printf("Message = %s",$e->__toString());}
/*** 设置参数array("trace"=>true)用于调试* __getLastRequest 返回请求信息* __getLastResponse 返回响应信息包括报错信息都会返回*/try{ $client = new SoapClient($server,array("trace"=>true)); $client->method($args);}catch(SoapFault $e){ echo $client->__getLastRequest(); echo $client->__getLastResponse(); echo $e->getMessage();}