SOAP VERSION 1.2 Chinese Manual 2

zhaozj2021-02-17  65

1 Introduction

SOAP V1.2 provides a simple and lightweight mechanism for exchanging structured and type information using XML pairs in a loose, distributed environment. SOAP itself does not define any application semantics, such as programming models or specific semantics implementations, it just defines a simple mechanism, expressed applying the application through a modular packaging model and the data of the data encoded in the module. Semantics. This capability of SOAP allows it to be used by many types of systems to extend from the message system to the RPC (Remote Procedure Call).

SOAP consists of four parts:

SOAP ENVELOP (see section 4), which constructs a whole representation framework that can be used to indicate what is in the message, and who should handle it, and this is optional or forced. SOAP ENCODING RULES (see section 5) defines an instance of a data type for switching applications defined by a module. SOAP RPC Representation (see section 7) defines a convention for representing remote procedures calls and responses. SOAP BINDING (see section 6) defines a convention using the underlying transport protocol to complete the SOAP envelope between the node.

To simplify this specification, these four parts are functioning. In particular, envelopes and encoding rules are defined in different namespaces, which is conducive to obtain conciseness through modularization.

This specification also defines two SOAP bindings (Binding) to describe how the SOAP message (Message) is transferred by or without HTTP extension framework [6] (HTTP EXTENSION FRAMEWORK). .

1.1 Design Goal

The main design goals of SOAP are concise and scalable. This means that there are some features in the traditional message system or distributed object system will not be included in the core specification of SOAP. These features include:

Distributed Garbage Collection; Batch Message Transmission / Processing (Boxcarring Or Batching Of Messages); Objects-by-Reference, support for distributed garbage collection); object activation (Activation, required object reference) stand by).

1.2 symbol agreement

This article "Must", "Must Not", "Required", "Shall", "SHALL NOT", "Should", "Shove Not", "Recommended", "May", "Optional" semantics should See RFC-2119 [2]. In this Chinese version of the specification, "must", "must not", "need", "will", "should", "should not", "should be recommended", " "," Optional ".

The namespace prefixed "ENV" and "ENC" used in this article are located in the following locations: "http://www.w3.org/2001/06/soap-envelop" and "http: // Www.w3.org/2001/06/soap-encoding ".

In all content of this article, the namespace prefix "XS" and "XSI" always assume that "http://www.w3.org/2001/xmlschema" and "http://www.w3.org/2001/ Xmlschema-instance is associated, which is defined by XML Schemas specification [10, 11].

It is worth noting that other uses of the namespace prefix are more casual and there is no significant semantic constraint. If the NRI of the namespace uses "http: //example.com / ..." or "http: //example.com / ...", this is some URI [4] dependent on application or context .

This specification uses the expansion of BNF (Backus-Naur Form) as a constructive language, refer to RFC-2612 [5].

Edited annotations will use a yellow background ID (may not be displayed on all media) and use the prefix "Ednote".

1.3 SOAP Message Example

The first example shows a simple notification message represented by SOAP. This message contains a message header "alertControl" and message body "alert", which is defined by the application, and is not defined by SOAP. The message header contains two parameters "priority" and "expires" for the processing of messaging intermediary and message recipients. In the message body, it is included in the actual transmission.

EXAMPLE 0

1

2001-06-22t14: 00: 00-05: 00

Pick Up Mary At School At 2PM

Sample SOAP MESSAGE Containing a Header Block and A Body Block

The SOAP message can be binded to different underlying protocols and can be used in many messaging modes. The following example shows how SOAP is used in HTTP connections, which fully uses the request / corresponding mechanism provided by HTTP (see Section 6).

Example 1 and Example 2 show an example of a SOAP / HTTP request and an example of a SOAP / HTTP response. The SOAP / HTTP request contains a message block that obtains the final trading price (which contains a simple parameter that indicates a stock code that requires quote. Similarly, similar to the previous example, GetLastTradePrice This XML element is not defined by SOAP itself. The requested service response also includes a simple parameter, the price of the stock. The SOAP envelope element is a top element of the XML document representing the SOAP message. XML namespaces are used to eliminate ambiguity that may exist between the SOAP identifier and the identifier defined.

EXAMPLE 1

POST / stockquote http / 1.1

Host: www.stockquoteserver.com

Content-type: text / xml; charSet = "UTF-8"

Content-Length: nnnn

SOAPACTION: "http://example.org/2001/06/quotes"

Env: encodingstyle = "http://www.w3.org/2001/06/soap-encoding"

XMLns: m = "http://example.org/2001/06/quotes">

DIS / SYMBOL>

Sample SOAP Message Embedded in an HTTP Request

Example 2 shows the SOAP message returned by the StockQuote service response from the request message described by Example 1.

EXAMPLE 2

HTTP / 1.1 200 ok

Content-type: text / xml; charSet = "UTF-8"

Content-Length: nnnn

Env: encodingstyle = "http://www.w3.org/2001/06/soap-encoding"

XMLns: m = "http://example.org/2001/06/quotes">

34.5

Sample SOAP Message Embedded in an HTTP Response

More examples are provided in Appendix A.

1.4 SOAP terminology

1.4.1 protocol concept

SOAP

A set of specifications and conventions such as the interaction process of the SOAP message is generated and received between the different applications required by SOAP messages.

SOAP binding

A set of specifications and rules that transmit SOAP messages over or within another underlying protocol for transmission. Typical SOAP bindings include transmitting a SOAP message in an HTTP message or transmitting SOAP messages over TCP.

SOAP node

The SOAP node handles the SOAP message according to the entire specification defined by the SOAP. The SOAP node is responsible for compliance with the rules of the SOAP message exchange and provides services to access through the SOAP binding of the underlying protocol. Any case where the SOAP agreed will cause the SOAP node to generate a SOAP error (see SOAP recipients and SOAP senders).

1.4.2 Data Packaging Concept

SOAP message

The SOAP message is the basic unit of communication between the peap nodes.

SOAP envelope

The SOAP envelope is the outermost structure of the SOAP message defined in the SOAP specification (SOAP Message) in the syntax. On the syntax, it contains all other elements.

SOAP entry

The SOAP entry is a structure in a syntax, which is used to include a logically single element, which is required to be processed by the SOAP node. A SOAP entry is identified by the full modifier of the outermost element of the entry, which is composed of a local name and a namespace URI. The SOAP entry encapsulated in SOAP HEADER becomes a HEADER entry, and the SOAP entry encapsulated in SOAP Body is a Body entry.

SOAP HEADER can be processed by any SOAP receiver (0 or more) of any SOAP recipient in the SOAP message path.

SOAP BODY

A set of SOAP entries (0 or more) that can be processed by the final SOAP recipient in the SOAP message path.

SOAP FAULT

A special SOAP entry for the SOAP node is generated to contain error messages.

The following chart demonstrates how a SOAP message is composed.

Figure 1: Encapsulation Model Illustrating the Parts of A SOAP Message

1.4.3 Messaging Manager and Receiver Concept

SOAP sender

SOAP senders are the SOAP node that issues a SOAP message.

SOAP recipient

The SOAP recipient is a SOAP node that accepts the SOAP message.

SOAP message path

A set of SOAP senders and SOAP recipients to transmit a simple SOAP message. These include initial SOAP senders, zero or more SOAP intermediaries, and final SOAP recipients.

Initial SOAP sender

The initial generator of the SOAP message is also the first node of the SOAP message path.

SOAP intermediary

The SOAP agent is that the SOAP recipient is also a SOAP sender, which is an application that the SOAP message can reach. When the SOAP message is transmitted along the SOAP message path, the SOAP intermediary will process a set of determined SOAP entries, then forward the message to the next SOAP node of the message path until the final SOAP recipient is transmitted.

End SOAP recipient

The final SOAP recipient that transmits the SOAP message via the SOAP message path is specified by the initial SOAP sender. If there is a SOAP error in the SOAP message path, the SOAP message will not reach the final recipient.

1.4.4 Data Coding Concept

SOAP data model

A set of abstract constructs, used to describe the generic data type and link relationships in the data.

SOAP data coding

Use one or more SOAP entries in the SOAP message to complete the data on the syntax method in accordance with the SOAP Data Model.

转载请注明原文地址:https://www.9cbs.com/read-30712.html

New Post(0)