How should this WSDL be used? Php->soapclient

Source: Internet
Author: User
How should this WSDL be used? Tokyu Php-->soapclient
Address: Http://in.commchina.net:8071/service.asmx?WSDL
Find out function: Var_dump ($soap->__getfunctions ());
Get: "Login login (loginwrapper $parameters)"
Query function Parameters: Var_dump ($soap->__gettypes ());
Get: "struct Loginwrapper {string _xml;}"
Specification input XML Description:

the number cannot be empty
The password cannot be empty


Use the following code:
$arr = Array (
' Param ' =>array (
' Number ' = ' 4******* ',
' Pwd ' = ' ******** '
)
);
try{
$wsdl = ' Http://in.commchina.net:8071/service.asmx?WSDL ';
$soap = new SoapClient ($WSDL);
$res = $soap->login (Array (' _xml ' = $arr));
}catch (Exception $e) {
Print_r ($e->getmessage (), true);
}

Error message: The server was unable to process the request. The data at the---> root level is invalid. Line 1, Position 1.


------Solution--------------------
Login Login (Loginwrapper $parameters)

struct Loginwrapper {
String _xml;
}

$param = Array (' _xml ' = '
the number cannot be empty
The password cannot be empty
');

$res = $soap->login (param);
Or
$res = $soap->_call (' Login ', Array ($param));
Or
$res = $soap->_soapcall (' Login ', Array ($param));
  • 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.