How does PHP call wsdl? what kind of classes are needed? who can provide detailed code? Thank you.
Reply to discussion (solution)
Depends on your needs
$ Wsdl = "http: // 192.168.1.2/jaxws/services/test? Wsdl ";
$ Client = new SoapClient ($ wsdl );
$ Param = array ('arg0' => 'arg0', 'arg1' => 'arg1 ');
$ Ret = $ client-> getUserinfoByID ($ param );
If ($ ret-> return) {print_r ($ ret-> return );}
Else {echo 'no user ';}
The specific SoapClient requires php soap support. you can check that there is soap in phpinfo,
The same is true for me, but an error is returned.
Wsdl is an interface specification for users
As long as the method and parameter you call are correct, is there any wsdl that is the same?
The same is true for me, but an error is returned.
What is the error?
$ Wsdl = "http: // XXX? Wsdl ";
$ Client = new SoapClient ($ wsdl );
Var_dump ($ client->__ getFunctions ());
I call var_dump ($ client->__ getFunctions () to display the following
Array
(
[0] => sysNotifyexTodoResponse sysNotifyexTodo (sysNotifyexTodo $ parameters)
)
How can I call this method.
$ Client-> sysNotifyexTodo (parameter );
How to set parameters is also required
Var_dump ($ client->__ getTypes ());
Take a look
Var_dump ($ client->__ getTypes ());
Result:
Array
(
[0] => struct sysNotifyexTodo {
String arg0;
}
[1] => struct sysNotifyexTodoResponse {
Int return;
}
)
That is
$ N = $ client-> sysNotifyexTodo (array ('arg0' => 'parameter value '));
Thanks very much to the moderator. The problem has been solved.
How can I accept the returned data next time?
Wsdl is an interface specification for users
As long as the method and parameter you call are correct, is there any wsdl that is the same?
Can you help me with the following information:
The content of $ client->__ getFunctions () is as follows:
Array ([0] => ossRequestResponse ossRequest (ossRequest $ parameters ))
$ Client->__ getTypes (); the content is as follows:
Array ([0] => struct ossRequest {WsRequestParam in0;} [1] => struct WsRequestParam {string encryptInfo; string extendInfo; string requestContent; int requestNo; int requestSystemNo; int versionNo;} [2] => struct ossRequestResponse {string ossRequestReturn ;})
The code is as follows:
$ Client = new SoapClient ($ wsdl );
$ AcctInfo = array (
'In0' => array (
'Encryption info' => '',
'Extendinfo' => '',
'Requestno' => '001 ',
'Requestsystemno' => '006 ',
'Versionno' => '1 ',
'Requestcontent' =>'<oss-request><QryType>I</QryType><QryId>400506105998</QryId></oss-request>'
)
);
$ Tmp = $ client-> ossRequest ($ acctInfo );
Why can't I send a request to the interface? the following error occurs: Fatal error: Maximum execution time of 30 seconds exceeded in C: \ wamp \ apps \ demo \ ws. php on line 25.
Error