public function request($param=[])
{
try
{
$soap = new SoapClient($this->serverUrl); //特别说明 服务端地址必须是带有 ?WSDL 的地址
$arr = $soap->__call("execute", $param);
$simplexml = simplexml_load_string(iconv("utf-8", "gbk//IGNORE", $arr), 'SimpleXMLElement', LIBXML_NOCDATA);//去除CDATA
$json = json_encode($simplexml);//XML转json字符串
$obj = json_decode($json,true);//字符串转json对象,可以用我们熟悉的方式访问xml了
return $obj;
}catch (Exception $e){
printf("Message = %s", $e->__toString());
return null;
}
}
{
try
{
$soap = new SoapClient($this->serverUrl); //特别说明 服务端地址必须是带有 ?WSDL 的地址
$arr = $soap->__call("execute", $param);
$simplexml = simplexml_load_string(iconv("utf-8", "gbk//IGNORE", $arr), 'SimpleXMLElement', LIBXML_NOCDATA);//去除CDATA
$json = json_encode($simplexml);//XML转json字符串
$obj = json_decode($json,true);//字符串转json对象,可以用我们熟悉的方式访问xml了
return $obj;
}catch (Exception $e){
printf("Message = %s", $e->__toString());
return null;
}
}