Jump to content

PHP SOAP server and client not working....getting error


ali_kiyani

Recommended Posts

Hi,

 

I created the following server:

 

function test($id)
{
if($id == "1")
	return "OK";
else
	return "Bye";
}

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

$server = new SoapServer("testserver.wsdl");

$server->addFunction('test');

$server->handle();

 

And my client is:

 

ini_set("soap.wsdl_cache_enabled", "0″);

$client = new SoapClient("http://localhost/soap/testserver.wsdl");

$id = $client->test("1");

print $id;

 

I am using XAMPP and phpinfo() shows that I have both SOAP client and server enabled. Anyway I tried to run the client in browser as follows:

 

http://localhost/soap/soapclient.php

 

But getting following error:

 

Warning: SoapClient::SoapClient(http://localhost/soap/testserver.wsdl) [soapclient.soapclient]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in

 

 

Do I need to register the server???? I thought I need to so I wrote this in browser:

 

http://localhost/soap/soapserver.php

 

But got error:

 

WSDLSOAP-ERROR: Parsing WSDL: Couldn't load from 'testserver.wsdl' 

 

I am on Windows XP Pro by the way. HELP!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.