找找有关NUSOAP的资料就简单了

解决方案 »

  1.   

    用nusoap这样
    $client = new soapclient("http://localhost/soap/ser2.wsdl", true);
    $message = $client->call('getMessage');用php5的soap库这样(没有用wsdl)
    $client = new soapclient(null, array("location"=>"http://localhost/soap/user_server5.php","uri"=>"http://test-uri/"));
    try 
    {
    $message = $client->__soapCall('getMessage',array());
    }catch (SoapFault $exception){}
      

  2.   

    用nusoap这样
    $client = new soapclient("http://localhost/soap/ser2.wsdl", true);
    $message = $client->call('getMessage')
    这个函数是要提供两个参数的,我是这样写的,但是什么都没打印出来如下:
    require_once('lib/nusoap.php');
    $client=new soapclientw("http://localhost/soap/ser2.wsdl", true);
    $result = $client->call('getMessage',array('param1' => 'a' ,'param2' => 'b'));
    //$result = $client->call('getMessage',"a","b");//这样写也不行
    print_r($result);运行后显示空白.
    用php5的soap库这样(没有用wsdl)啊,那怎么办啊.
      

  3.   

    $result = $client->call('getMessage',array('param1' => 'a' ,'param2' => 'b'));
    ========================这样应该是没有问题的,如果不行应该是别的问题,再检查参数是否符合wsdl定义。
    或者打印$client->getError();看看有没有错误
      

  4.   

    打印了,没有什么错的.
    不过这句$client = new soapclient("http://localhost/soap/ser2.wsdl", true);我是这么写的$client = new soapclient("http://localhost/soap/ser2.wsdl");如果加上true的话会显示Fatal error: Maximum execution time of 30 seconds exceeded E:\My Webs\phpExample\lib\nusoap.php on line 2029
    这样.
      

  5.   

    /**
    有个webservice 网站中有个WSDL页面提供了一个getMessage函数,PHP 怎么样调用WSDL中的函数并显示出来?谢谢了
    */
    看是否取得getMessage函数体,再参照eval来用;
      

  6.   

    打印了,没有什么错的.
    不过这句$client = new soapclient("http://localhost/soap/ser2.wsdl", true);我是这么写的$client = new soapclient("http://localhost/soap/ser2.wsdl");如果加上true的话会显示Fatal error: Maximum execution time of 30 seconds exceeded E:\My Webs\phpExample\lib\nusoap.php on line 2029
    这样.
    =========================
    第二个参数是指第一个参数是webservice具体地址还是wsdl地址,如果缺省不给就是false,代表第一个参数是具体webservice地址而非wsdl地址。
    可以把最大执行时间放长点,webserivce毕竟是比较耗时间的。
      

  7.   

    <?php 
    $client = new SoapClient("http://www.xxx.wsdl");
    var_dump($client->__getFunctions());
    ?>已经得到具体的函数了.如下面array(1) { [0]=> string(49) "float getMessage(string $country1, string $country2)" }
      

  8.   

    但是调用不了呢.我想调用getMessage()调用不了
      

  9.   

    如果WEB SERVICE 对方应该告诉你调用格式的,有的甚至还要有用户名,密码
      

  10.   

    $client = new soapclient('http://localhost/TestService/Service1.asmx?WSDL', true);
    //要访问的webservice: http://localhost/TestService/Service1.asmx$param = array('str' => 'China');
    //参数名:str   参数值:China$result = $client->call('HelloWorld', array('parameters' => $param), '', '', false, true,'document','encoded');
    //方法名:HelloWorld以上用法试用是可以行的
      

  11.   

    没有用户名和密码,
    我想访问的webservice不是以这.asmx结尾的,是以.wsdl结尾的.