Using XML technology to construct remote services in PHP (1 ). In the future, the web will be service-centered. xml_rpc makes writing and application services very simple. This article introduces the xml_rpc standard and its php implementation, and demonstrates how to use the xml_rpc standard to make writing and application services very simple in the future. This article introduces the xml_rpc standard and its php implementation, and demonstrates how to develop the xml_rpc service and customer program in php through examples.
I. service web
From the simple method adopted by content providers to the future ideas of uddi (universal description, discovery and integration), there have been a lot of comments on "service web" in the industry. In the early stage of web development, it is just a distribution center for documents, providing only some information that can be browsed. With the development of web, running services on the web is becoming more and more attractive. In the future, web will become a carrier for enterprises to provide convenient services for customers and other enterprises. The collaboration between B2B and B2C models can be seen as a Service web.
A very important question is what services can be provided on the web? Web provides many services, some of which are currently in use, and some will appear in the near future. To illustrate the problem, a small part of the services that can be provided through the web are listed below:
◆ Topic-oriented vertical search engine.
◆ Knowledge base for users to find information.
◆ You can consult an expert system.
◆ Banking services.
◆ News and information publishing services.
◆ Digital payment-related services.
◆ Graphic processing service.
◆ Health and health services.
So what is the correct way for enterprises and organizations to provide services through the web? This is a very important issue. Today, some services provide html interfaces. they provide services in the form of documents, but what is hidden behind the service interface? In the competition to occupy the web, web browsers are not alone. mobile phones, handheld devices, and microwave devices all want to access the web, query databases, convert data, and extract information. To implement a truly service-oriented web, there should be another layer under the presentation layer (html.
II. xml_rpc standard
Xml is perhaps the most important criterion in the past 10 years. The xml vocabulary (vocabulary) provides a cornerstone for enterprises to construct a service environment. To build a service web, it is necessary to learn the xml_rpc standard. this is not only because xml_rpc is useful for putting services on the web, but also because xml_rpc is a standard that has been formed and is easy to use. For B2B services, the standards for providing services are extremely important. companies that comply with the standards can use the services provided by other companies to achieve rapid growth. It cannot be imagined that a real service web can be established based on various private service standards, and services must have a standard that can be followed.
Xml_rpc is a standard for internet distributed processing. Rpc is short for remote procedure call. it is a remote call mechanism used to call processes that may reside on other machines and may be written in other languages. Remote process calling is an important pillar of distributed computing. For example, in a distributed computing environment, we can find and use the process of performing addition and subtraction operations on other machines, the process of performing addition operations may be written in apl and run on rs6000 machines. the process of performing subtraction operations may be written in c and run on unix. Other developers who want to use this distributed calculator can also use them, or they can use another better calculator.
In rpc, the process (procedure) is the most important component, and the server provides the process for the client to call. The process can receive parameters and return results. Xml_rpc uses http as the protocol carrier and implements the rpc mechanism through the xml vocabulary for sending and receiving data. The xml_rpc server receives the xml_rpc request and returns the xml_rpc response. the xml_rpc client program sends the xml_rpc request and receives the xml_rpc response. Servers and customers must handle responses and requests as required by the xml_rpc standard.
1
Bytes. This document introduces the xml_rpc standard and php implementation, and demonstrates how...