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

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
asha
Forum Newbie
Posts: 3
Joined: Fri Jul 07, 2006 7:34 am
Location: India

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

Post 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
Last edited by asha on Fri Mar 02, 2007 4:42 am, edited 1 time in total.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post 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
asha
Forum Newbie
Posts: 3
Joined: Fri Jul 07, 2006 7:34 am
Location: India

Post 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/"));
Post Reply