Page 1 of 1

PHP Webservice in PHP 5 - SOAP-ERROR: Parsing WSDL

Posted: Thu Mar 01, 2007 2:06 am
by asha
Hi Folks,

I have developed PHP webservice using NuSOAP and php 5.x and we have also created client scripts to invoke server soap methods. All these are available in the RedHat Linux machine.

Both the server and client scripts are available in the same Linux machine.

If i call the server SOAP method using local ip, it is working fine. But if i call the same with public ip(external ip) i get the following error

Code: Select all

Warning: SoapClient::__construct(http://x.x.x.x/opendoc/soap/ dynserver_4.php?wsdl) [function.--construct]: failed to open stream: HTTP request failed! in /opt/lampp/htdocs/opendoc/soap/dynclient_5.php
on line 8

Warning: SoapClient::__construct() [function.--construct]: I/O warning : failed to load external entity "http://x.x.x.x/opendoc/soap/ dynserver_4.php?wsdl" in /opt/lampp/htdocs/opendoc/soap/ dynclient_5.php on line 8

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://x.x.x.x/opendoc/soap/dynserver_4.php? wsdl' in /opt/lampp/htdocs/opendoc/soap/dynclient_5.php:8 Stack trace: #0 /opt/lampp/htdocs/opendoc/soap/dynclient_5.php(9): SoapClient->__construct('http://x.x.x...', Array) #1 {main} thrown in /opt/lampp/htdocs/opendoc/soap/dynclient_5.php on line 8


Client Script

Code: Select all

<?php
        $wsdl="http://x.x.x.x/soap/dynserver_4.php?wsdl";
        // If i replace the above ip with local ip then it is working fine.
        $client = new soapclient($wsdl);

        echo $client->Authenticate("Authenticate TEST")."<br>";
        echo $client->ClearShop("Clearshop TEST")."<br>";
        echo $client->PostData("PostData TEST")."<br>";
        echo $client->RetrieveData("RetrieveData TEST")."<br>";
        echo $client->SendMail("SendMail TEST")."<br>";

?>
And the Linux machine is not under any proxy and firewall

Expecting the solution ASAP, coz the situation is so critical.

Thanks in advance

Posted: Thu Mar 01, 2007 5:41 am
by dude81
Look at the following code. A space while loading dynserver_4.php?wsdl. Fix this problem and see

Code: Select all

"http://x.x.x.x/opendoc/soap/ dynserver_4.php?wsdl" in /opt/lampp/htdocs/opendoc/soap/ dynclient_5.php on line 8

Posted: Fri Mar 02, 2007 4:41 am
by asha
While creating the soap client by replacing the below line, the external ip works fine. Find the code below:

Code: Select all

$wsdl="http://x.x.x.x/soap/dynserver_4.php?wsdl"; 
$client = new SoapClient(null, array('location' => $wsdl,'uri' => "http://test-uri/"));