Jump to content

Help on webService


Kalpesh77

Recommended Posts

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/hello_world_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:

<?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:

<?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.

 

Link to comment
https://forums.phpfreaks.com/topic/149630-help-on-webservice/
Share on other sites

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.