This worked perfectly fine for me, although the nusoap library conflicted
with my PHP SOAP extension, so i had to disable the PHP SOAP ext. by
commenting the following line in the php.ini file
;extension=php_soap.dll
Please check the following.
* I am running on PHP v 5.2.8 on Windows with nusoap.php,v 1.94 2005/08/04
* When I invoked the SOAP Server URL directly '
http://localhost/nusoap/helloworld.php'
<http://localhost/TestProject/nusoap/helloworld.php>,
I got this message
'Clientmethod '' not defined in service'. Looks like in your case the SOAP
Client is not able to access the soap server URL, please check the file
permission for the soap library as well as the soap server and client php
files.
* Also check if there are any .htaccess files that are causing some file
access issues.
Regards,
Krishna Shasankar
http://www.krishnashasankar.com | http://www.clickoffline.com
On Fri, May 29, 2009 at 4:18 PM, Surajit Koly <chansuro@...> wrote:
>
>
> 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]
>
>
>
[Non-text portions of this message have been removed]