How to use this wsdl? PHP & gt; soapclient address: http://in.commchina.net: 8071/service. asmx? WSDL
Find the function: var_dump ($ soap->__ getFunctions ());
Get: "Login (LoginWrapper $ parameters )"
Query function parameters: var_dump ($ soap->__ getTypes ());
Get: "struct LoginWrapper {string _ xml ;}"
Xml description entered in the manual:
The number cannot be blank.
The password cannot be blank.
The code is as follows:
$ 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 cannot process the request. ---> The data at the root level is invalid. Row 1, position 1.
Reply to discussion (solution)
Login (LoginWrapper $ parameters)
Struct LoginWrapper {
String _ xml;
}
$ Param = array ('_ XML' =>'
The number cannot be blank.
The password cannot be blank.
');
$ Res = $ soap-> Login (param );
Or
$ Res = $ soap-> _ call ('login', array ($ param ));
Or
$ Res = $ soap-> _ soapcall ('login', array ($ param ));
? Exam: http://blog.csdn.net/fdipzone/article/details/21810347
$ Res = $ soap-> Login ($ param );
Or
$ Res = $ soap-> _ soapCall ('login', array ($ param ));