Open hanfeicode opened 4 years ago
$url = 'http://api.com/soap.php';
// $params = array('servcie' =>'Erp.Site.Index',"username"=>"ssssssbbbbbbbb");
$params = array('servcie' =>'Erp.Site.Index');
try {
$client = new SoapClient(null,
array(
'location' => $url,
'uri' => $url,
)
);
var_dump(json_encode($params));
echo "
";
var_dump(array(json_encode($params)));
echo "
";
$data = $client->__soapCall('response',array(json_encode($params)));
// $data = $client->__soapCall('api', $params);
//处理返回的数据。。
var_dump($data);
}catch(SoapFault $fault){ echo "Error: ".$fault->faultcode.", string: ".$fault->faultstring; }
1、 array(3) { ["ret"]=> int(404) ["data"]=> object(stdClass)#2 (0) { } ["msg"]=> string(64) "非法请求:接口服务{"servcie":"Erp.Site.Index"}不存在" }
$data = $client->__soapCall('api',array(json_encode($params))); var_dump($data);
2、 Error: SOAP-ENV:Server, string: Function 'response' doesn't exist $data = $client->__soapCall('response',array(json_encode($params)));
3、严格按照文档来执行的 请问错误在哪