Jump to content


Photo

PHP SoapClient and SoapServer problem


  • Please log in to reply
No replies to this topic

#1 Geez

Geez
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 11 April 2006 - 03:15 PM

Hi,

I'm pretty experienced with PHP but this really bites me. I've created a SoapServer with PHP5's builtin SOAP extension. Unfortunatley I cannot seem to talk with it using PHP's SoapClient. I keep getting a "Error Fetching http headers" error (indicating the WebService does not respond).

On my development environment (laptop running PHP 5.1.2 on windows/ apache 2.0) I have no problems when running and connecting with the webservice (locally).

But when I put the WebService online (on a webserver) it fails.

However, only when I use PHP (SoapClient). When I'm connecting to the remote WebService using ASP.NET it does work! (http://www.soapclien.../test/test.wsdl)

The webserver runs Linux with Apache 1.3 and PHP 5.1.2

I've also tried to connect with a PHP SoapClient running on my laptop to the remote SoapServer running on the webserver (also error).

During the test sessions I've turned on logging to see if the Remote WebService receives a hit . The log file is blank when I use the PHP SoapClient (explaining the error fetching HTTP Headers).

These are the locations of the files and the source code:


[a href=\"http://www.zoekned.nl/test/client.php\" target=\"_blank\"]http://www.zoekned.nl/test/client.php[/a] (SoapClient)

<?
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://www.zoekned.nl/test/test.wsdl");
print_r($client->searchCompanies("iets"));
?>

server.php -> [a href=\"http://www.zoekned.nl/test/server.php\" target=\"_blank\"]http://www.zoekned.nl/test/server.php[/a] (WebService)

<?
ini_set("soap.wsdl_cache_enabled", "0");

/***
 * @param string $what
 * @return string 
 */
function searchCompanies($what){
    $result = "Results!!!";
    return $result;
}

$server = new SoapServer("test.wsdl");
$server->addFunction("searchCompanies");
$server->handle();
exit();
?>

The WSDL file is found here: [a href=\"http://www.zoekned.nl/test/test.wsdl\" target=\"_blank\"]http://www.zoekned.nl/test/test.wsdl[/a]

Has anyone else experienced this, or could someone tell me if they can connect to my SOAPServer using PHP 5's SoapClient?

It must be something with the SoapClient since ASP.NET can connect with it.....

Any help is appriciated...

Cheers,

Geez




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users