In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to call the soap method of php". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Php soap method calls: 1, open "php_soap.dll" in the php.ini file; 2, query web service methods and parameters and data types; 3, splice xml strings according to development documents; 4, execute code in the browser.
How do I call the php soap method?
Php calls soap to realize docking
Implementation process of SOAP call under PHP5
Taking the development of iPhone 6 mobile phone reservation interface of a company as an example, this paper introduces the implementation process of SOAP call under PHP5.
I. basic concepts
SOAP (Simple Object Access Protocol) simple object access Protocol is a simple protocol for exchanging information in a distributed or distributed environment. It is a XML-based protocol that consists of four parts: SOAP envelop, which defines a framework that describes what is in the message, who sent it, who should accept and handle it, and how to handle it. SOAP encoding rules (encoding rules), which represent instances of the data types that the application needs to use; SOAP RPC representations (RPC representation), which represent protocols for remote procedure calls and replies; and SOAP bindings (binding), which use the underlying protocol to exchange information.
WSDL (Web Service Description Language) is the standard XML format for describing XML Web services. WSDL is proposed by developers such as Ariba, Intel, IBM and Microsoft. It defines the relevant operations and messages sent and received by a given Web service in an abstract way independent of the specific language. As far as its definition is concerned, you can't think of WSDL as an object interface definition language. For example, application architectures such as CORBA or COM use the object interface definition language. WSDL remains protocol neutral, but it does have built-in support for binding SOAP, thus establishing an inextricable relationship with SOAP. So, when I discuss WSDL in this article, I will assume that you use SOAP as your communication protocol.
Although SOAP and WSDL are the two major standards of web service, they are not necessarily related and can be used independently. The relationship between them is similar to that between HTTP and Html. The former is a protocol, while the latter is a description of an Web Server.
II. Configuration under PHP5
In the configuration file php.ini of php, find the
Extension=php_soap.dll
Then remove the previous; sign and restart the web service
Query web service methods, parameters and data types
The incoming order interface of a provincial telecom company is http://***.******.com/services/AcceptedBusiness?wsdl.
We use the _ _ geunctions () and _ _ getTypes () methods of SoapClient to view the methods, parameters, and data types of the interface
Only the interfaces listed in _ _ getFunctions can be called by soap.
Create the code soap.php in the root directory
After running: http://localhost/soap.php in the browser, the result is returned as follows
Array ([0] = > ArrayOf_xsd_anyType introduceAcceptedBusiness (string $c3, string $c4, string $linkman, string $linknum, string $num, string $idcard, string $remark, string $address) [1] = > ArrayOf_xsd_anyType introduceAcceptedBusinessByAiZhuangWei (string $subname, string $linkphone, string $idcard, string $address, string $businesstype, string $marketcode, string $surveycode, string $commanager, string $commanagerphone, string $string, bendiwang $bendiwang, bendiwang $bendiwang String $remark) [2] = > string introduceAcceptedBusinessByStandardInterface (string $xmlStr) [3] = > string introduceAcceptedBusinessByCallOut (string $xmlStr) [4] = > string introduceAcceptedBusinessByYddj (string $xmlParam) [5] = > ArrayOf_xsd_anyType queryAcceptedBusinessByAiZhuangWei (string $surveycode, string $starttime, string $endtime) [6] = > string queryCallOutOrderByConfig (string $xmlParam) Array ([0] = > anyType ArrayOf_xsd_anyType [])
There is a method introduceAcceptedBusinessByStandardInterface (string $xmlStr), which will be the interface to be used as mentioned in the development documentation, with an argument of xml string
In addition, SoapHeader authentication is mentioned in some interfaces, so you need to add the _ _ setSoapHeaders method
IV. Submit the entry order
This step is to concatenate the xml string according to the development document, and then pass it as a parameter to introduceAcceptedBusinessByStandardInterface
Create an acceptedbusiness.php, as follows
After execution in the browser, return to
0 successful entry! 2014100905523549742 "how to call the soap method of php" is introduced here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.