My environment is WAMP with PHP 5.3 I have all the always_populate_raw_post_data = On I have tried doing the trace as well and also ensured that there is no extra spaces there in the code before or after the ?php tag. I have also ensured that there is no extra space in the parameter sent but still its not resolved.
I have tried almost all the fixes available over the internet that i could browse in the last 6 hours or so but no results yet. Please help me out. I am, getting this error:
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in C:\wamp\www\myweb\client.php:10 Stack trace: #0 C:\wamp\www\myweb\client.php(10): SoapClient->__soapCall('hello', Array) #1 {main} thrown in C:\wamp\www\myweb\client.php on line 10
server.php
<?php
require_once('lib/nusoap.php');
$server = new soap_server();
$ns="http://localhost/myweb";
$server->configureWSDL('hello',trim($ns));
$server->wsdl->schemaTargetNamespace=trim($ns);
$server->register('hello');
function hello($name)
{
if(!$name){
return new soap_fault('Client','','Put your name!');
}
$result = "Hello, ".$name;
return $result;
}
$server->service(file_get_contents('php://input'));
exit();
?>
client.php
<?php
require_once ('lib/nusoap.php');
$name="testname";
$param = array('name'=>trim($name));
$client = new SoapClient('http://localhost/myweb/server.php?wsdl');
$response = $client->__soapCall('hello',$param);
if($client->fault)
{
echo "FAULT: <p>Code: (".$client->faultcode."</p>";
echo "String: ".$client->faultstring;
}
else
{
print "here";
echo $response;
}
?>
Any help is appreciated. Many thanks.