<?php
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测试,接口是好的,可以得到值。这东西弄的我郁闷死,求那位兄台帮忙解决一下,谢谢了。

解决方案 »

  1.   

    这里看不出来的,,,,去检查SoapClient,和GetListLine实现方法
      

  2.   

    http://www.ungb.com/sky/LineService.asmx?WSDL
    这个接口现在是开着的,你们用PHP帮我调试一下试试,我在线等。
      

  3.   


    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);
    可以的哈,你直接打开http://www.ungb.com/sky/LineService.asmx?WSDL看下GetListLine方法需要的参数!!
    你没有传需要的参数
      

  4.   

    $url = "http://www.ungb.com/sky/LineService.asmx?WSDL";
    $soapClient = new SoapClient($url);/* 这段代码用于查看可用的函数和数据的
    echo '<xmp>';
    print_r( $soapClient->__getFunctions ()); 
    print_r($soapClient->__getTypes () ); 
    */$ar = array(
      'strLine_Id' => '',
    );$rs =  $soapClient->GetListLine($ar);
    echo $rs->GetListLineResult);
      

  5.   

    谢谢dingsongtao大哥了,你的能用,我unsoap以前没怎么玩过,呵呵