解决方案 »

  1.   

    Could not connect to host
      

  2.   

    提示你没有访问该host的权限,就是访问不到!
      

  3.   

    1 用try catch语句来处理exception, 用client->getError()捕获到详细的错误 
    2 连不上一般是防火墙等造成的。
    3 参照http://blog.csdn.net/fengye245/article/details/7847232
      

  4.   

    用C#是ok的。。 但是用php就是不行。。郁闷。。
      

  5.   

    c#的代码很简单。但是用php就是不行
       String url = "http://221.12.5.98:1000/cyyfoutservice.asmx";
       Hashtable ht = new Hashtable();
       XmlDocument xx = WebSvcCaller.QuerySoapWebService(url, "GetCanBookInfo", ht);
       Console.Write(xx.OuterXml);    Console.ReadKey();
      

  6.   

    翻了以前的demo,好像php需要写一个服务器文件,这个服务器文件要去指定调用你的协议文件,并且指定暴露出去的接口(方法),LZ你坚决认为是php的问题,你还是去找找网上那些php的webservice的案例,一步步来吧!
    PHP访问PHP的例子,客户端:$client = new SoapClient('http://192.168.0.109:81/webService/ser2/soapserver.php?wsdl');
        //链接服务器端 先做一个身份验证
        $h = new SoapHeader('mynamespace', 'checkUser', 'xiebuqing');
        $client->__setSoapHeaders($h);    try{
         //调用greet()方法   获取请求的结果
         $result = $client->greet();
        }catch(SoapFault $e){
         echo $e->getMessage();
         exit;
        }服务器端:/注册wsdl 这里指定暴露出去的类和函数
    $server = new SoapServer('hello.wsdl');
    $server->setClass("Server");
    $server->handle();
      

  7.   

    可以了,不用 WSDL 就可以$client = new SoapClient(null, array(
      'location' => 'http://221.12.5.98:1000/cyyfoutservice.asmx',
      'uri' => 'http://tempuri.org/',
      'trace' => true,
      'soap_version' => SOAP_1_2,
    ));
    $p = $client->__soapCall('GetCanBookInfo',array()) ;
    print_r($p);