Fatal error: Uncaught SoapFault exception: [WSDL]

后端 未结 4 603
被撕碎了的回忆
被撕碎了的回忆 2021-01-15 11:03

I\'m having trouble calling a web service I\'ve set up from PHP. The obfuscated adress http://XXX.XXX.XXX.XXX/test.asmx?wsdl in the error message below returns

4条回答
  •  抹茶落季
    2021-01-15 11:36

    If you're using nusoap (php 5.2 has a native soapclient, which I prefer), the first thing I see is your arguments. Argument #2 for nusoap's soapclient constructor should be boolean TRUE here, if you're using the WSDL, and not an array. Try:

    $objClient = new soapclient("http://XXX.XXX.XXX.XXX/test.asmx?wsdl",true);
    print_r($objClient->HellowWorld());
    

    That's how i've been able to work with wsdl in the past.

    If you're using the native client, and having problems with the wsdl, you can always bypass it and make straight calls, like so:

    $objClient = new soapclient(null,array('uri'=>'http://xxx/test.asmx','location'=>'http://xxx/test.asm'));
    $objClient->__call('HelloWorld',array());
    

    That should work, but isn't as easy to navigate as wsdl.

提交回复
热议问题