PHP调用webservice,但取不到返回值,在网页上直接获取是可以拿到返回值的。
获取返回值的方法如下:
ini_set("soap.wsdl_cache_enabled",0);
function getSoapData($cardNo){
echo '##########################,';
echo $cardNo;
try {
// 示例webservice地址.
$client = new SoapClient ( "http://soap.org/wsdl?", array (
'encoding' => 'UTF-8'
) );
$strinfo = $client-> GetOpenID( array (
'CardNo'=>$cardNo
) );
echo ',##########################'.$client->GetOpenID($cardNo);
} catch ( Exception $e ) {
echo 'ERR\n\n\n';
Think\Log::record ( $e, 'ERR' );
}
return $strinfo;
}
网页上的返回值是:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<GetOpenIDResponse xmlns="http://www.xxxxxxxx.cn">
<GetOpenIDResult>fdlsakfjsdlafsdkllfk02943ielkdsjfalsdk12878</GetOpenIDResult>
</GetOpenIDResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
请问该怎么才能取到返回值??谢谢.
慕田峪7331174