An easy soap error.

Source: Internet
Author: User
Simple SOAP Error ...
Always error:
Nobelium?
Fatal error:uncaught SoapFault exception: [Client] looks like we got no XML document in E:\xampp\htdocs\photowall\registe Raction.php:22 Stack Trace: #0 E:\xampp\htdocs\photowall\registeraction.php: Soapclient->__call (' Test ', Array ) #1 E:\xampp\htdocs\photowall\registeraction.php: Soapclient->test () #2 {main} thrown in E:\xampp\htdocs\ photowall\registeraction.php on line 22

The above that garbled a bit strange .... Because it happens when I don't export anything ....
Do not know is God horse meaning ....
Ask you what the big God is wrong ...


Here's the code:

A class, in usrhelper.php:
 
  Class Usrhelper
{
Public Function test ()
{
Return "This is a test";
}
}
?>


Server.php is:
 
  
Require_once ' usrhelper.php ';


Array (' uri ' = ' = ' usr_service '));
$server->setclass (' Usrhelper ');
$server->handle ();
?>


When invoking the 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--------------------
Don't you have a WSDL or asmx file? The error seems to be that you can provide a file in XML format
------Solution--------------------
After testing, the code you posted doesn't have any problems. Can get results This is a test

Observe the error message you posted (this is not garbled), and the error appears in the code that is related to line 22nd of registeraction.php,
And the code you put out is much less.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.