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!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.