How does PHP call wsdl?

Source: Internet
Author: User
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

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.