Simple Object Access Protocol (SOAP) is actually a Web service technology, but the data exchange formats between clients and servers in Web services are implemented through flexible XML mode. The main advantage of Web services is the level of interoperability between client and server information and data exchange through the network. The SOAP standard uses the Simple Object Access Protocol (SOAP) of XM, which is actually a Web service technology, however, the data exchange format between the client and server in the Web service is implemented through the flexible XML mode. The main advantage of Web services is the level of interoperability between client and server information and data exchange through the network. Use XM as the SOAP standard
Simple Object Access Protocol (SOAP) is actually a Web service technology, however, the data exchange format between the client and server in the Web service is implemented through the flexible XML mode.
The main advantage of Web services is the level of interoperability between client and server information and data exchange through the network. The SOAP standard uses XML to construct data and define data types and information in a schema-neutral format.
For programming languages, you only need to provide the data type and the name of the function that needs to be called on the remote server. The SOAP Library converts information and formats written in the host language into messages in XML format, including called functions and provided parameters.
The W3C example shows the structure of SOAP. Call a remote SOAP function
GetEndorsingBoarder()
The calling program on the client generates the XML message shown in listing 1.
List 1. call a remote SOAP functionGetEndorsingBoarder()
K2
Fatbob
The whole message sent by the SOAP client is placed in the SOAP envelope. The envelope content is the details of the message.
The called function is obviouslyGetEndorsingBoarder
It includes two parameters: manufacturer and model. It can be seen that it converts a local string that may adopt binary encoding into an XML string. Because XML is platform-independent, the host uses the SOAP system to exchange messages without complicated binary encoding and decoding.
The server returns a response using another XML-encoded SOAP envelope. this is the return value of the function. The response format of the SOAP request is the same as that of the function, except thatResponse
, As shown in listing 2.
List 2. SOAP Request Response
Chris Englesmann
Generally, you do not need to write the SOAP message yourself. the SOAP library will automatically generate the message. However, the structure and simplicity of the SOAP envelope indicate that it is very easy to use the SOAP standard to share information.
SOAP greatly simplifies message exchange and remote function call. The Remote Procedure Call (RPC) standard requires complex methods to process the serialization of binary data. to send more structured information, a detailed description and two-way information conversion are required.
Using SOAP, XML serialization greatly reduces this complexity, making cross-platform, cross-language integration and data exchange easier.
The above is the details about the XML mode-SOAP introduction. For more information, see other related articles in the first PHP community!