简体   繁体   中英

Fatal error: Uncaught SoapFault exception [wsdl] SOAP-ERROR

i'm trying to make a test with wsdl , soap and php , and i'm gettin the error :

Fatal error: Uncaught SoapFault exception [wsdl] SOAP-ERROR

I have for now 2 files , one is a given wsdl , and client.php just for test:

<?php

   $sClient = 'http://localhost/test/service/wbs.wsdl';
   $wsdl = new SoapClient ( '$sClient') ;
   echo "test";

?>

and i'm getin this error :

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ' hp://localhost/test/service/wbs.wsdl' : failed to load external entity " hp://localhost/test/service/wbs.wsdl" in C:\\wamp\\www\\Outbound\\client.php:4 Stack trace: #0 C:\\wamp\\www\\test\\client.php(4): SoapClient->SoapClient(' hp://localh...') #1 {main} thrown in C:\\wamp\\www\\test\\client.php on line 4

I did change the extension of soap in php.ini , i did all the modification posted in other posts , but nothing works .

$wsdl = new SoapClient ( '$sClient') ;

This would not work. Use:

$wsdl = new SoapClient ( "$sClient") ;

Or - better:

$wsdl = new SoapClient ( $sClient) ;

Try it

$client = new SoapClient("http://{$_SERVER['HTTP_HOST']}/test/service/wbs.wsdl");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM