>  기사  >  백엔드 개발  >  关于webservice得不到值,小弟求帮助解决思路

关于webservice得不到值,小弟求帮助解决思路

WBOY
WBOY원래의
2016-06-13 13:34:06767검색

关于webservice得不到值,小弟求帮助
function getline(){
 $client = new SoapClient('http://www.ungb.com/sky/LineService.asmx?WSDL');  
 try { 
  $result = $client->GetListLine();
  print_r($result);
  return $result;
 }catch(SoapFault $e){
  return -1;
 }
}
?>
我通过上面的代码得到的是空值,但我用soapui测试,接口是好的,可以得到值。

这东西弄的我郁闷死,求那位兄台帮忙解决一下,谢谢了。。。。。。。。。。。。。。。。

------解决方案--------------------

PHP code

define('R_P',dirname(__FILE__)."/");
include_once(R_P.'class/nusoap/nusoap.php');

$wsdl="http://www.ungb.com/sky/LineService.asmx?WSDL";
$ParmArray=array("literal"=>"");
$client = new nusoap_client($wsdl,true);
$client->soap_defencoding = 'utf-8';
$client->decode_utf8 = false;
$client->xml_encoding = 'utf-8';
$client->timeout = 900;
$client->response_timeout = 900;
$result = $client->call("GetListLine",array("parameters"=>$ParmArray));
print_r($result); <div class="clear">
                 
              
              
        
            </div>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.