Help on webservice

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kalpesh
Forum Commoner
Posts: 54
Joined: Sun Sep 21, 2008 5:04 am

Help on webservice

Post by kalpesh »

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:

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);
?>
 
Then i create soap client which has name hello_world.php and code has follows:

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);
?>
 
Please help me.
Thanks in advance.
Post Reply