1

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.

MansoorShiraz
  • 118
  • 1
  • 8
  • possible duplicate of [How to get rid of "Uncaught SoapFault exception: \[Client\] looks like we got no XML document in..." error](http://stackoverflow.com/questions/2540438/how-to-get-rid-of-uncaught-soapfault-exception-client-looks-like-we-got-no-x) – Jay Blanchard May 18 '15 at 12:09
  • the solution mentioned there didnt work out. i have tried almost all of the possible solutions over the internet. – MansoorShiraz May 19 '15 at 20:42

0 Answers0