A simple soap error... always reports the following error: why? Fatal & nbsp; error: & nbsp; Uncaught & nbsp; SoapFault & nbsp; exception: & nbsp; [Client] & nbsp; looks & nbsp; like & nbsp simple soap error...
Always reported errors:
Why?
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in E: \ xampp \ htdocs \ photowall \ registeraction. php: 22 Stack trace: #0 E: \ xampp \ htdocs \ photowall \ registeraction. php (22): SoapClient->__ call ('test', Array) #1 E: \ xampp \ htdocs \ photowall \ registeraction. php (22): SoapClient-> test () #2 {main} thrown in E: \ xampp \ htdocs \ photowall \ registeraction. php on line 22
The above garbled code is a bit strange... because it appears when I have not output anything ....
I don't know what it means ....
I 'd like to ask you what went wrong...
The following code is used:
A class in usrHelper. php:
class usrHelper
{
public function test()
{
return "this is a test";
}
}
?>
Server. php is:
require_once 'usrHelper.php';
$server = new SoapServer(null,
array('uri' => "usr_service"));
$server->setClass('usrHelper');
$server->handle();
?>
When calling a service:
$client = new SoapClient(null, array(
'location' => "http://127.0.0.1/photowall/server.php",
'uri' => "usr_service",
'trace' => 1 ));
//$client->addUsr($username,$password);
$ans = $client -> test();
echo $ans;
------ Solution --------------------
Do you have no wsdl or asmx files? It seems that you want to provide an xml file.
------ Solution --------------------
After testing, the code you posted has no problems. The result is this is a test.
Observe the error message you posted (this is not garbled) and the error appears in the code related to registeraction. php 22nd,
The code you post is much less.