In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
CentOS SOAP expansion module triggers the service side to perform the corresponding operation, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
The CentOS SOAP extension module is built in from PHP5, through which we can easily send a CentOS SOAP message to Service, which triggers the service side to perform the corresponding operation and return the result.
First of all, to make sure that the CentOS SOAP extension is installed, the fact that it is not installed is that there will be an error of php error Class' SoapClient' not found when running code that uses soapclient. At this time, you should install php-soap. You can easily use the yum update installation package > yum install php-soap to update these installation packages on CentOS SOAP. After updating these installation packages, you need to restart the apache service, and then the SoapClient class can be used in php script. The following is an example of how to use it:
1.in WSDL mode,soapCall application web service, the example uses asp.net 's web service, providing service.asmx pages, calling and viewing are relatively simple, and most of the example in the manual is of this type, which is relatively simple.
Protocol sent by CentOS SOAP:
POST / servicepath/service.asmx HTTP/1.1 Host: 211.186.1.4 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://211.186.5.15/Service/ServiceMethod" string string string
Call method:
$client = new SoapClient ("http://www.xxx.com/service/service.asmx?WSDL"); / / send parameter values $param1 =" p1 "; $param2 =" p2 "; $param3 =" p3 "to the SOAP server
/ / serviceParam1,serviceParam2,serviceParam3 is the parameter name corresponding to the sending parameter value (or the field name provided by the service side) $param = array ('serviceParam1' = > $param1,'serviceParam2' = > $param2,'serviceParam3' = > $param3)
/ / the method is named ServiceMethod, and the parameter array is $param. By default, the passed parameter array $arr = $client- > _ _ soapCall ('ServiceMethod',array (' parameters' = > $param) is marked with the parameters field); print_r ($arr)
Here, print_r ($arr) prints out an object, similar to
StdClass Object ([BindValidateResult] = > 01062947546)
After many attempts, I found that using $arr [1], $arr [0] and $arr [BindValidateResult] could not get a valid value. Later, I found that the return value can be accessed through $arr- > BindValidateResult.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.