Help on webservice
Posted: Mon Mar 16, 2009 7:26 am
hi
I try to create web service for simple application.
But I got error like this:
Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://127.0.0.1/WebService/Service3/he ... server.php' in C:\Program Files\EasyPHP 2.0b1\www\WebService\Service3\hello_world.php:3 Stack trace: #0 C:\Program Files\EasyPHP 2.0b1\www\WebService\Service3\hello_world.php(3): SoapClient->SoapClient('http://127.0.0....') #1 {main} thrown in C:\Program Files\EasyPHP 2.0b1\www\WebService\Service3\hello_world.php on line 3
I am giving full code of my application:
First i create soap server which has name hello_world_server.php and code has follows:
Then i create soap client which has name hello_world.php and code has follows:
Please help me.
Thanks in advance.
I try to create web service for simple application.
But I got error like this:
Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://127.0.0.1/WebService/Service3/he ... server.php' in C:\Program Files\EasyPHP 2.0b1\www\WebService\Service3\hello_world.php:3 Stack trace: #0 C:\Program Files\EasyPHP 2.0b1\www\WebService\Service3\hello_world.php(3): SoapClient->SoapClient('http://127.0.0....') #1 {main} thrown in C:\Program Files\EasyPHP 2.0b1\www\WebService\Service3\hello_world.php on line 3
I am giving full code of my application:
First i create soap server which has name hello_world_server.php and code has follows:
Code: Select all
<?php
include("lib/nusoap.php");
$srv = new soap_server();
$srv->register("hello_world");
function hello_world($name)
{
return array("data"=>"Hello World, {$name}!");
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : "";
$srv->service($HTTP_RAW_POST_DATA);
?>
Code: Select all
<?php
include("lib/nusoap.php");
$soap = new soapclient("http://127.0.0.1/WebService/Service3/hello_world_server.php");
$output = $soap->call("hello_world", array("name" => "Josh"));
print_r($output);
?>
Thanks in advance.