Hi all,
I am new to SOAP.
can you please explain why this errors are coming.
------------------------------------------------------
Warning: SoapClient::SoapClient(http://localhost/nusoap/helloworld.php)
[soapclient.soapclient]: failed to open stream: HTTP request failed!
HTTP/1.0 500 Internal Server Error in C:\xampp\htdocs\nusoap\helloclient.php
on line 4
Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning :
failed to load external entity "http://localhost/nusoap/helloworld.php" in
C:\xampp\htdocs\nusoap\helloclient.php on line 4
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:
Couldn't load from 'http://localhost/nusoap/helloworld.php' : failed to load
external entity "http://localhost/nusoap/helloworld.php" in
C:\xampp\htdocs\nusoap\helloclient.php:4 Stack trace: #0
C:\xampp\htdocs\nusoap\helloclient.php(4): SoapClient->SoapClient('
http://localhos...') #1 {main} thrown in
C:\xampp\htdocs\nusoap\helloclient.php on line 4
----------------------------------------------------------------
I am giving you the code for client below
-------------------------------------------
File: helloclient.php
<?php
require_once('lib/nusoap.php');
$client = new soapclient('http://localhost/nusoap/helloworld.php');
$return = $client->call('hello', array('bob'));
if(!$err = $client->getError()){
echo 'Result: '.$result;
} else {
echo 'Error: '.$err;
}
print_r($return);
?>
I am giving you the code for server below
------------------------------------------------
File: helloworld.php
<?php
// Pull in the NuSOAP code
require_once('lib/nusoap.php');
// Create the server instance
$server = new soap_server;
// Register the method to expose
$server->register('hello');
// Define the method as a PHP function
function hello() {
return 'Hello, ' . $name;
}
// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
Can you please guide me what should I do.
Thanks
Surajit
[Non-text portions of this message have been removed]