The use of XML in PHP remote service technology structure (I)
A Web service
Content providers from the simple method used by the UDDI (Universal Description, Discovery and Integration) concept of the future, the industry has a large number of "service Web" notes and comments. On the Web start-up phase, it is only a distribution center for documentation, just trying to give some information can be found. With the Web's development, and run Web services in the increasingly attractive. The future, Web will become the Enterprise to customers and other businesses provide convenient services to the carrier. B2B and B2C model can be inter-collaborative service as a Web.
A very important question is, Web on how to provide what services? Web services can provide many, some of which are now in the use of services, some services in the near future will appear. In order to illustrate the problems listed below can be a small part of the services provided through the Web:
|Subject-oriented vertical search engines.|
|For users of the Knowledge Base to find information.|
|Users can ask the question of the expert system.|
|News and information publishing services.|
|digital pay-related services.|
|Graphics processing services.|
|Health and health services.|
In that case, businesses and organizations to provide services through the Web the right way to what is it? This is a very important issue. Today, some service providers HTML interface, they adopted the form of documents, but in the service interface behind what? Web in the occupation of the race, Web browsers are not alone, mobile phones, handheld devices, as well as equipment such as microwave ovens want to visit the Web, query the database, convert data, extract information, and so on. To achieve true service Web, in the presentation layer (HTML) should be there is another layer under.
Second, XML_RPC standards
xml is perhaps the last 10 years, the most important standards, xml vocabulary (Vocabulary) for the enterprise structure provides the cornerstone of service environment. To build a Web service standards XML_RPC there is a need to study, not only because XML_RPC for services on the Web on the very useful, but because a XML_RPC has been formed, it is easy to adopt standards. B2B services for the services provided, the standard is extremely important to follow common standards companies can make use of the services provided by other companies access to rapid growth. Can not imagine the service in a variety of private standards can be a real service to build Web, services must have a standard that can be followed.
XML_RPC is an Internet-oriented distributed processing standards. RPC is Remote Procedure Call (RPC) of the abbreviation, it is a mechanism for long-distance calls for the call may reside in other machines may be used on other languages as well as the process of preparation. Remote Procedure Call is an important pillar of distributed computing. For example, in a distributed computing environment, we can find and use in other machines running on the implementation of the operation of addition and subtraction process, the implementation of the process of addition operations may be prepared by APL, RS6000 machines in operation, the implementation of the process of subtraction operation c may be prepared to run in Unix. Other use of this distributed the same calculator can be used to develop them, or he could choose another calculator better.
In RPC, the process (Procedure) is the most important components, the server is provided for the process of client-side call. Process can receive parameters and return results. HTTP as a protocol to XML_RPC carrier, send and receive data through the xml vocabulary achieve the RPC mechanism. Server and client must be in accordance with the requirements of the standard XML_RPC response and request processing.
Third, XML_RPC agreement XML_RPC complete specification <br> can find http://www.xmlrpc.com/spec. The following is a description of its main points.
|3.1 XML_RPC request|
XML_RPC requests should be HTTP POST request, it is the XML format of the text. Part of the XML format of the request are as follows:
| <? Xml version = "1.0"?> |
<methodName> Examples.getStateName </ methodName>
<value> <i4> 41 </ i4> </ value>
Specify where the data is sent to the URL is not specified here. If the RPC server is specifically designed to deal with, it may be "/." The above XML document is a payload of "methodCall" structure. methodCall must contain a "methodName" sub-elements, "methodName" sub-element contains a description of methods to be called the string. How to interpret "methodName" the contents of the decision by the server, for example, the implementation of it can be a file name, can be recorded in the database name, or any other thing. If the process of receiving parameters, "methodCall" may contain a "params" element, as well as a number of "param" sub-elements. Every "param" element contains a descriptor with the value type, the type descriptor as follows:
|<i4> Or <int>||Four-byte signed integer, such as 12|
|<boolean>||0 (false), or 1 (true)|
|<string>||String, such as "Hello World"|
|<double>||Double-precision floating-point numbers with symbols, such as the -12.214|
|<dateTime.iso8601>||Date / Time, such as 19980717T14: 08:55|
|<base64>||base64-encoded binary data, such as eW91IGbid0IHJlQgdGhpcyE|
Value can be a structure, structural elements used to describe <struct>. <struct> Each contain multiple <member>, each contains a <name> and <member> a <value>. The following is a structure consisting of two elements:
| <struct> |
<name> Name </ name>
<value> <string> Member1 </ string> </ value>
<name> Member2 </ name>
<value> <i4> 19 </ i4> </ value>
<struct> can be nested arbitrarily <value> can contain arbitrary <struct> or other types, including <array>.
Value can be an array type, the array elements used to describe <array>. <array> Each element contains a <data> elements, <data> element which can contain any number of elements <value>. The following is an example of the array elements:
| <array> |
<value> <boolean> 0 </ boolean> </ value>
<value> <i4> 9 </ i4> </ value>
<value> <string> Hello </ string> </ value>
no name <array> elements. As shown in examples, <array> the value of the element can be of various types. <array> elements can be nested, any <value> or <array> can contain other types, such as described above <struct>.
|3.2 XML_RPC response [/ b]|
XML_RPC response is an HTTP response content type is text / xml. Response format of the text as follows:
| <? Xml version = "1.0"?> |
<value> <string> ABCDEFG </ string> </ value>
<methodResponse> may contain a <params> structure, or <fault> structure may contain a specific call from the success of the decision process. XML structure and <params> the same request, <fault> syntax elements are as follows:
| <fault> |
<name> FaultCode </ name>
<value> <int> 4 </ int> </ value>
<name> FaultString </ name>
<value> <string> Error! </ String> </ value>
Php XML Application Articles
- ⑤ browser VML graphics board - view. Php
- A php with XML, XSLT, Mysql combination of the use of the installation of articles
- Second php with XML, XSLT, Mysql combination of the use of code chapter
- Xml file generation lightweight category
- One for the MySQL Class PHP XML
- Using MySQL and PHP to create XML
- PHP and XML-based PDF document generation technology
- The use of XML in PHP
- How to mix XML and PHP?
- A very convenient type of XML! ! Original Oh!
- The use of XML in PHP remote service technology structure (Lower)
- Removed from the SQL data into XMl format
- The use of XML in PHP remote service technology structure (I)
- Notes DOMXML function
- ② Script VML graphics board - VMLgraph. Js, XMLtool.js
- ③ resources VML graphics board - VMLgraph. Xml
Can't Find What You're Looking For?
Rating: Not yet rated