SOAP protocol specification 1. Introduction SOAP provides a simple, lightweight mechanism for exchange structured and type information in a dispersion or distribution environment. SOAP itself does not define any application semantics, such as programming models, or specific semantics; in fact, it defines a simple representation of application semantics by providing a package model with a standard component and a mechanism to encode data in the module. mechanism. This allows SOAP to be used to pass through messages to various systems of RPC. SOAP includes three parts
The SOAP package (see Section 4) defines what a overall framework is used to indicate what content contains, and who will handle these contents and these contents are optional or required. SOAP encoding rules (see Section 5) define a series of mechanisms that use instances of data types defined by the application. SOAP RPC representation (see Section 7) defines an agreement to represent remote procedure calls and answers. Although these three parts are described as part of SOAP, they are functionally intersecting. In particular, packaging and coding rules are defined in different names. This modular definition method adds the simplicity outside the SOAP package, SOAP coding rules, and SOAPRPC protocols. This specification also defines two protocols. Binding, describing how the SOAP message is included in the HTTP message [5] in the case where there is or without HTTP extension framework [6]. 1.1 Design Goal SOAP main design goals are simplicity and scalability, which means that some of the traditional message system and distribution object systems are not part of the SOAP specification. These properties include:
Distributed Debris Collection Billy Batch Passage Object Reference (Required Distributed Debris Collection) Activation Mechanism (Required Object Reference) 1.2 Symbols Convention This article "Must", "Must NOT", "Required", "Shall" , "Shall NOT", "Should", "Shove NOT", "Recommended", "May", and "Optional" interpretation in RFC-2119 [2]. The famous domain prefixed in this article is "http://schemas.xmlsoap.org/soap/envelope/" http://schemas.xmlsoap.org, "http://schemas.xmlsoap.org/soap/envelope/" / SOAP / EnCoding / "Association. In the entire document, the name domain prefix "XSI" is assumed to be connected to the URI "http://www.w3.org/1999/xmlschema-instance" (defined in XMLSChema specification [11]). Similarly, the name prefix "XSD" is assumed to be connected to the URI "http://www.w3.org/1999/xmlschema" (defined in [10]). The name domain prefix "TNS" is used to represent an arbitrary name field. All other name domain prefix are just examples. The basic form "Some-URI" of the name domain URI indicates that some of the URI [4] dependent on the application or context. This specification describes certain structures with expansion BNF (described in RFC-2616 [5]). 1.3 SOAP Message For example, in this example, the GetLastTradePrice SOAP request is sent to the Stockquote service. This request carries a string parameter and Ticker symbol, and a floating point number is returned in the SOAP response. The XML name is used to distinguish SOAP flags and application-specific flags. This example illustrates the HTTP binding defined in Section 6. If the rules that manage XML loads in SOAP are completely independent of HTTP, because in fact, the load is carried by HTTP. There are more examples in Appendix A.
Example 1 Embed SOAP Message in HTTP Request Post / stockquote http / 1.1 host: www.stockquoteserver.com content-type: text / xml; charset = "UTF-8" Content-Length: NNNN SOAPACTION: "Some-URI" < SOAP-ENV: ENVELOPE XMLNS: SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV: EncodingStyle = "http://schemas.xmlsoap.org/soap/encoding/">
In order to properly handle a message or message, the SOAP processor needs to understand: the exchange mode used (one-way, request / response, multiple transmission, etc.), this mode, the recipient's task, the RPC mechanism (if some The use of the use of data (as described in Section 7), the data is performed or encoded, and there are other necessary semantics. Although attributes (such as SOAP ENCODINGSTYLE, see Section 4.1.1) can be used to describe certain aspects of a message, but this specification does not force all receivers to have the same attribute and take the same attribute value. For example, a particular application may know that an element indicates a RPC request that follows Section 7, but some applications may consider all messages to which the element is transmitted in one-way transmission, not similar to Section 7. Answer mode. (Translator Note: The SOAP message of the interactive parties is not necessarily to follow the same format setting, but only need to exchange information with the format of the two parties, it is possible) 3. All SOAP messages are used in relation to XML. XML form encoding (more information about XML, see [7]) In a message generated by SOAP applications, all elements and properties defined by SOAP must include the correct name domain. The SOAP application must be able to process the SOAP name in the message it receives (see Section 4.4), and it can handle SOAP messages without SOAP names, just like they have the right name. SOAP defines two names (more information about XML names, please see [8])
The name domain flag of the SOAP package is "http://schemas.xmlsoap.org/soap/envelope/" SOAP coding rule is "http://schemas.xmlsoap.org/soap/encoding/" The document type declaration cannot be included in the SOAP message, and the message processing instruction cannot be included. [7] SOAP uses the "ID" type "ID" property to specify the unique flag of an element, and the attribute is partial and no verification. SOAP uses the "href" property of the "URI-REFERENCE" type to specify a reference to this value, and this attribute is partial and no verification. This follows the style of XML specification [7], XMLSChema specification [11] and XML connection language specification [9]. In addition to the SOAP MUSTUNDERSTAND attribute (see Section 4.2.3) and SOAPACTOR properties (see Section 4.2.2), the attributes and their values are typically allowed in the XML document instance or Schema (the same effect is the same). That is, a default or fixed value is declared in DTD or SCHEMA and set it in the XML document instance. 4. SOAP package SOAP message is an XML document, including a required SOAP package, an optional SOAP header and a required SOAP body. In this normative remainder, this XML document is referred to when it comes to the SOAP message. The name domain markers of the elements and attributes defined in this section are: "http://schemas.xmlsoap.org/soap/envelope/". One SOAP message includes the following sections: 1. In the XML document representing this message, the package is top element. 2. Applying SOAP exchange information is dispersed and has no pre-agreement, and the SOAP header provides a mechanism for adding some elements (Feature) of this SOAP message to the SOAP message. SOAP defines a small amount of attribute to indicate whether this element is optional and who is processed. (See Section 4.2) 3. The SOAP is a container that contains the information you want to contain the message (see Section 4.3). SOAP defines a FAULT element for the SOAP body to report error messages. The grammar rules are as follows: The encapsulation element name is "envelope" must appear in the SOAP message. You can include a domain declaration and additional properties. If additional properties are included, these properties must qualify a domain. Similarly, "envelope" can include additional sub-elements, which must also define a name domain and follow the SOAP body element. SOAP header (see section 4.2)
The element name is "header" may appear in the SOAP message. If you appear, you must be the first direct child element of the SOAP package element. The SOAP headers can contain multiple entries, each of which is the direct child element of the SOAP header element. All direct child elements of all SOAP heads must define a domain. SOAP body (see Section 4.3)
The element name is "body" must appear in the SOAP message and must be a direct child element of the SOAP package element. It must be followed directly after the SOAP head element (if any). Otherwise it must be the first direct child element of the SOAP package element. The SOAP body can include multiple entries, each of which must be the direct child element of the SOAP element element. The direct sub-elements of the SOAP element can define a domain. SOAP defines the SOAPFault element to represent the error message. 4.1.1 Soap EncodingStyle Attribute EncodingStyle Global Properties Used to represent the serialization rules for SOAP messages. This property can appear in any element, the scope of action is similar to the scope of the name domain declaration, and the content of this element and all of its sub-elements that do not overload this attribute. The SOAP message is not defined by default. The attribute value is a sequential list of one or more URIs. Each URI determines one or more serialization rules for different degrees of deserializing SOAP messages, as follows: "http://schemas.xmlsoap.org/ SOAP / Encoding / "http://my.host/encoding/restricted http://my.host/encoding/" "Sequence rules defined in Section 5" http: //schemas.xmlsoap. ORG / SOAP / Encoding / "OK. Messages using this specific serialization rule should be used with an EncodingStyle property. In addition, all serialization rules in the URI starting with "http://schemas.xmlsoap.org/soap/encoding/" are consistent with the SOAP coding rules defined in Section 5. A zero-length URI ("") explicitly shows that the elements contained are not included in any coded form. This can be used to cancel all encoding declarations of the previous element. 4.1.2 Packaging Release Model SOAP does not define a regular version of the main version number and auxiliary version number. SOAP messages must have a package element associated with the name "http://schemas.xmlsoap.org/soap/envelop/". If the SOAP package elements in the SOAP message received by the SOAP application are associated with other name domain, the application must discard this message. If the message is received through the request / response protocol, the application, the application must answer a SOAP VERSIONMISMATCH error message (see Section 4.4). 4.2 SOAP head SOAP provides a flexible mechanism between groups that communicate with each other: extend the message in a dispersed but standard manner without pre-agreement. You can add an entry in the SOAP head to achieve this extension, typical examples are certified, transaction management, payment, etc. The head element is encoded to the first direct child element of the SOAP package element. All direct sub-elements of the head element are called entry. The encoding rules of the entry are as follows: an entry has its complete element name (including the name domain URI and local name). The direct child element of the SOAP head must have a domain restriction. The SOAP ENCODINGSTYLE attribute can be used to indicate the encoding form used (see Section 4.1.1) SOAP Mustunderstand Attributes (see Section 4.2.2) and SOAPACTOR properties (see Section 4.2.2) can be used to indicate how to handle this entry and who Treatment. (See Section 4.2.1) 4.2.1 Use the SOAP head attribute defined in this section of the Head Properties to determine how the SOAP message will handle the message in the manner described in Section 2. The SOAP application that produces SOAP messages should only use these SOAP head attributes only in the direct child elements of the SOAP header. The recipient of the SOAP message must ignore all SOAP head attributes in the direct sub-elements that are not in the SOAP header.
The following example is a SOAP header, including an element flag "Transaction", "Mustunderstand" with a value of "1" and value 5. This should be encoded as follows:
A entry is determined by its element full name (including the name domain URI and local name). The direct child element of the SOAP element may be a name domain limit. The SOAP ENCODINGSTYLE property may be used to indicate the encoding method of the entry (see Section 4.1.1). SOAP defines a FAULT entry to report an error message. (See Section 4.4) 4.3.1 The relationship between SOAP headers and body Although the head and body are defined as an independent element, they are actually related. The relationship between the body entry and the headline is as follows: The body entry is semantically equivalent to the Actor attribute to the default value and the key entry "1" is "1". The default actor is used without using the actor attribute. (See Section 4.2.2) 4.4 SOAP Error SOAP error elements are used to carry errors and / or status information in the SOAP message. If there is a SOAP error element, it must appear in a physical entry method and appear once in one element element. SOAP error elements define four sub-elements:
The FaultCodefaultCode element provides software with an algorithm mechanism that identifies this error. The SOAP error element must have a Faultcode child element, and its value must be a legitimate name (defined in the [8] section). SOAP defines some SOAP FaultCode descriptions of basic SOAP errors (see Section 4.4.1). FaultstringFaultString elements provide an error interpretation instead of software processing. The FaultString element is similar to the 'REason-phrase' in HTTP (see [5], Section 6.1). SOAP error elements must have FaultString child elements, and it should provide some interpretation of erroneous essentials. The FaultactorFaultActor element provides information on the message path (see Section 2). It is similar to the SOAP Actor attribute (see Section 4.2.2), just the SOAP Actor refers to the destination of the headline, Faultactor refers to the wrong source. The value of the faultactor property is the URI used to distinguish the wrong source. The application that is not the final destination of the SOAP message must contain the FaultActor element in the SOAP Fault element. The ultimate destination of the message can be explicitly indicated using the Faultactor element that it generates this error (see the Detail element below) The DetAildEtail element is used to carry the error message to be in the application related to the Body element. If the content of the Body element cannot be successful, the Detail child element must be included. It cannot be used to carry an error message belonging to the headline. The detailed error message of the headline must be carried by the headline. There is no Detail element in the fault element indicates that this error is not related to the processing of the Body element. When there is a mistake, this can be used to distinguish whether the Body element is handled correctly. All direct child elements of the Detail element are called a Detail entry, and each Detail entry encodes an independent element in the Detail element. The encoding rules of the Detail entry are as follows (see Example 10): A detail entry is determined by its element full name (including the name domain URI, and local name). The direct child element of the SOAP element may be a name domain limit. The SOAP ENCODINGSTYLE property may be used to indicate the encoding method of the Detail entry (see Section 4.1.1). You can also have other Fault sub-elements as long as they are named domain restrictions. 4.4.1 SOAP Error Code When describing errors defined in this specification, the faultcode value defined in this section must be used in the FaultCode element. These faultcode depends on the name domain logo as "http://schemas.xmlsoap.org/soap/envelop/". Recommended (not required) to use this name when defining methods other than this specification. The default SOAP FaultCode value is defined in an extensible manner, allowing the new SOAP FaultCode value to be defined and compatible with the existing Faultcode value. Used mechanism is similar to basic state classes such as 1xx, 2xx, 3xx defined in HTTP (see Section 10 of [5]), but they are defined as an XML legitimate name (see Section 3 [8]), not an integer . The character "." (Point) is a separator of the faultcode, and the error code on the left is more common than the error code on the right. Such as: Client.Authentication This document defines the faultcode value:
Name Meaning The VersionMismatch handler discovers that the SOAP package element has a non-legal name (see Section 4.1.2) The Mustunderstand handler does not understand or disappoints the direct child elements of the SOAP header element containing the value of the "1" Mustunderstand attribute. (See Section 4.2.3) Client Client Error class represents the format of the message or does not contain the appropriate correct information. For example, messages may lack correct authentication and payment information. Generally, it indicates that the message cannot be reissued without modification. See Section 4.4 Section 4. Description of SOAP Fault Detail child elements. Server Server error class represents the processing of the message instead of the message itself makes the message message cannot be processed correctly. For example, it may be to communicate with other processors when processing a message, but it does not respond. This message may be successful at a later time. Details of the SOAP Fault child elements See Section 4. SOAP encoding SOAP encoding format Based on a simple type system, the common characteristics of type systems such as programming language, database, and semi-structural data are summarized. A type or a simple (scalar) type, or a composite type that is combined by several parts, each of which has its own type. These types will be described in detail below. This section defines serialization rules for type objects. It is divided into two levels. First, a given Schema (translator Note: Schema here: Schema here is not compliant with XML syntax, but only means a generalized way to represent message structures), it constructs XML syntax. Schema. Then, a type of system's schema and a specific value consistent with this Schema are constructed, and an XML document instance is constructed. Conversely, a copy of the initial value can be constructed in accordance with the XML document instance and the initial Schema generated in accordance with these rules. The name domain markers of the elements and attributes defined in this section are "http://schemas.xmlsoap.org/soap/encoding/". The following example assumes that the name domain is declared in the elements of the previous layer. Encourage the data model and encoding method described in this section, but other data models and encoding methods can also be used in SOAP. (See Section 4.1.1) 5.1 Coding Type Rule XML in XML allows very flexible data encoding. SOAP defines a smaller rule set. This section defines these coding rules at the total level, which will describe details of a specific type of coding rule. The encoding rules defined in this section can be used in conjunction with the RPC calls and response mappings described in Section 7. The following terms are used to describe coding rules:
A "value" is a combination of a string, type (number, date, enumeration, etc.) or several simple values. All values have specific types. A "Simple Value" has no name, such as a specific string, integer, enumeration value, etc. A "compound value" is the combination of the associated value, such as orders, stock reports, street addresses, and more. In "Compound Value", each associated value is potentially distinguished by name, order, or both. This is called "a ccessor". Examples of composite values include orders and stock reports, and more. An array is also a composite value. In the composite value, multiple Accessor have the same name as allowable, such as RDF. A "array" is a composite value, and the member value is distinguished from each other in the array. A "struct" is also a composite value, the only difference between member values is the Accessor name, and the Accessor name is different. A "Simple Type" is a simple value class, such as the class called "String" "Integer", and enumeration class, etc. A "Compound Type" is a class of composite values. An example of a composite type has a single class, which has the same Accessor name (Shipto, Totalcost, etc.), but there may be different values (possibly set to the determined value later). In the composite type, if the Accessor name in the type is different, it may be the same as the Accessor name in other types, ie, the Accessor name plus the type name forms a unique flag, this name is "local name" . If the name is a direct or indirectly-based URI, then no matter what type it appears, this name can be uniquely marked this Accessor, such a "global scope". The serialization information of the values associated in Schema is given, it is possible to determine that some values are only related to one instance of an Accessor. Other cases cannot be determined. When and only an Accessor references a value, this value can be considered "Single-Reference", if there is more than one accessor reference it, then treat it as "multi-reason". Note that possible a determined value is "Single-Reference" in a schema, and "multi-reference" in another schema is. On the statement composition, an element may be "independent" or "embedded". A separate element indicates any elements of the topmost of the serialization. All other elements are embedded elements. While using the XSI: Type property, the structure and type of the value can be made to be described herein, but the type of serialization rule allows the value of the value is only set to SCHEMA. Such SCHEMA may use the symbolic system described in "XML Schema Part 1: Structure" [10] and "XML Schema Part 2: DataTypes" [11], or other symbolic systems may also be used. Note that although serialization rules can be used in composite types other than array and structures, many Schema only contain array and structural types. The serialization rules are as follows: All values are expressed in the form of elemental content.
A multi-reference value must be represented as an independent element, and a Single-Reference value is preferably not shown (or other means). For each of each element, the value of the value must be described in one of the following three modes:
The element of the element has an XSI: Type property to which the element belonging is a child element with a SOAP-ENC: ArrayType property (this property may be default) element, or the name of the element has a specific type, and the type can be determined by Schema. A simple value is expressed as character data, that is, there is no child element. Each simple value must have a type, this type or a type of XML Schemas Specification, Part 2 [11], or has a source type (see Section 5.2). A composite value is encoded as a sequence of an element, each Accessor represents an embedded element, the element name of the element, and the name of Accessor. If the name of Accessor is the type thereof, the element name of the element is not qualified, otherwise the corresponding element name is qualified. (See Section 5.4) A simple value or composite value of a multi-reference encodes a separate element that contains a local attribute that does not have the verification. The property is named "ID", the type "ID" (according to XML Specification) [7]). Each Accessor of the value corresponds to an empty element, which has a local, no verification property, the property name "href", type "URI-Reference" (in accordance with XML Schema Specification [11]), "HREF" The value of the attribute references the URI flag of the corresponding independent element. Strings and character arrays represent the simple type of Multi-Reference, but special rules make them more efficient in ordinary situations (see Section 5.2.1 and 5.2.3). The Accessor of the string and character array value may have a name "ID" and type "ID" (in accordance with XML Specification [7]). If so, all other Accessor of all this value encodes an empty element, this element has a local, no verification property, the property name "href", type "uri-reason" (according to XML Schema Specification [11 ]), The value of the "HREF" attribute references the URI flag of the element that contains this value. Allows a value to have multiple references when encoding, just like multiple references, but this can only be used when the meaning of this XML document instance is not changed from the context. The array is a composite value (see Section 5.4.2). The SOAP array is defined as a type "soap-enc: array" or a type derived from it. The SOAP array can be one-dimensional or multi-dimensional, and their members are distinguished from each other in order. An array value is represented as a series of elements that reflect this array, and array members appear in ascending order. For multi-dimensional arrays, this dimension change is the fastest. Each member element is named a separate element. (See Rule 2) The SOAP array can be a Single-Reference or Multi-Reference value, so it can be represented as embedded elements or independent elements. The SOAP array must contain a "soap-enc: arrayty" property, which specifies the dimension of the type and array of elements that contain the elements.
The value of the "soap-enc: arraytytype" property is as follows: arraytypevalue = atype asize atype = qname * (rank) Rank = "[" * (",") "]" asize = "[" #olength "]" Length = 1 * Digit "Atype" structure is a type name that is included in the element. It is represented as qname and is limited to the "Type" attribute of the XML element declaration (this means that all values containing elements are consistent with this type. That is, that is, the type referenced in SOAP-ENC: A RRAYTYPE must be the type or super type of each array member). In the case of arrays of arrays or "jagged arrays", the type component is encoded as "InnerMost" type and follows a RANK structure after the type name in each layer of the nested array starting from the first layer. When the multi-dimensional array is encoded, from the first, each dimension is separated by a comma. The "Asize" structure contains a comma-separated list, numerical value 0, 1 or other integer representing the length of each dimension of the array. Integer 0 indicates that no detailed size is specified, but it may be determined after checking the actual number of actual members of the array. For example, a three member's integer array is "int [] [5]", its atype value is int [] ", asize value is" [5] ". Similarly, a three member two The ArrayTyPEVALUE value of the dimensional integer array is "int [,] [3]", its atype value is int [,] ", and the asize value is" [3] ". A SOAP array member may contain a "soap-enc: offset" property representing the location offset value in the entire array. This is used to indicate a partial offset value of a partially stored value (see Section 5.4.2.1). Similarly, a member of a member may contain a "soap-enc: position" property representing the location in the entire array, which is used to describe members of the sparse array (see Section 5.4.2.2). The definition of "soap-enc: offset" and "soap-enc: position" attribute values are as follows: ArrayPoint = "[" #olength "]" Offset value and location From 0 Start NULL value or default value may be omitted accssor elements To represent. NULL values may also be represented by an Accssor element that contains a value of '1' XSI: NULL attributes, and other properties and values dependent on the application may also be used to represent NULL values. Note that rule 2 allows independent elements and array members named elements of the value type. 5.2 Simple Type SOAP uses all types in the "XML Schema Part 2: DataTypes" specification [11] "Built-in DataTypes" section as simple types, including values, and value ranges. E.g:
Types Example INT58502FLOAT314159265358979E 1NEGATIVEINTEGER-32768STRINGLOUIS "Satchmo" ARMSTRONG
Data types declared in the XML Schema specification can be used directly in element Schema, or new types derived from these types can also be used. An example of a data instance with these types of elements with these types:
However, if two Accessor refer to the same string instance (or subtype of the string), this is not a substantive problem, which can be encoded as two Single-Reference values, as shown below:
The Schema fragment of this example is as follows:
5.2.3 Character array A character array may encode a Single-Reference or Multi-Reference value. The encoding rule of the character array is similar to the coding rule of the string. In particular, element values containing the character array may be by a "ID" attribute, the additional Accssor element may have the corresponding "HREF" attribute. It is recommended to use the 'base64' encoding in XML Schemas [10] [11] to represent the fuzzy character array of Base64 encoding algorithms in 2045 [13]. However, due to the limitations of line length, Base64 encoding is usually applied in MIME, and Base64 encoding is generally not applied in SOAP. But providing the "SOAP-ENC: Base64" subtype makes it available for SOAP.
5.3 Multi-state Accessor Many languages allow access to multiple types of values to Accessor, each type available at runtime. A polymorphic Accessor instance must contain a "XSI: Type" property description type of the actual value. For example, a polymorphic Accessor encoding called "COST" type value is "xsd: float" is as follows:
Structure: A "struct" is a composite value, the only difference between its member values is the Accessor name, any two Accessor names are different. Array: A "array" is a composite value, its unique difference between its member values is the order of order. SOAP also allows sequences of other data outside the structure and arrays, such as data such as Directed-Labled-Graph Data Model, and a single node has many different Accssors, some more than once. SOAP serialization rules do not require the underlying data model to distinguish between Accssors, but if there is such a order, these Accssors must be encoded in this order. 5.4.1 Composite values, structural and value reference composite values are encoded as Accessor elements. When Accessor is distinguished by name (such as structure), the Accessor name is an element name. The name of the ACCESSOR has unrestricted names, and other Accessors have limited names. The following example is the structure of the type "BOOK":
The following is a SCHEMA fragment describing the above structure:
When "Person" and "address" are Multi-Reference, the above form is correct. If they are Single-Reference, they must be embedded in the form, as shown below:
If you add a limit, any two people will not have the same address, and the address can be a street or email address, and a book can have two authors, the encoding is as follows:
The following is a SCHEMA fragment describing the above structure:
SOAPACTION: "http://electrocommerce.org/abc#mymessage" soapaction: "MyApp.sdl" soapaction: "" SOAPACTION: 6.2 Soap HTTP Answer Soap HTTP Follow the HTTP status code to represent communication status information. Semantics. For example, the 2XX status code indicates that this customer request containing SOAP components has been successfully received, understood, and accepts. If an error occurs when an error occurs, the SOAP HTTP server must issue an HTTP 500 "Internal Server Error" and contain a SOAP FAULT element in this response (see Section 4.4) indicates this SOAP handler. 6.3 HTTP Extension Framework A SOAP message can be used with HTTP extension framework [6] to distinguish whether there is a SOAP HTTP request and its goal. It is the strategy and ability to use extended frames or ordinary HTTP related to communication parties. By using a necessary extended declaration and "M-" HTTP method prefix, customers can force the HTTP extension framework. The server can use the HTTP status code 510 "not extended" to force Using the HTTP extension frame. That is, use an additional return, any party can find the other policy and execute according to the execution. The extended flag used to indicate that SOAP uses the extended frame is: http://schemas.xmlsoap.org/soap/envelop/ 6.4 SOAP HTTP Example 3 Example Example Example 3 Using POST SOAP HTTP POST / stockquote http / 1.1 Content-Type: Text / XML; Charset = "UTF-8" Content-Length: nnnn soapaction: "http://electrocommerce.org/abc#mymessage" Example 4 SOAP HTTP with an extended frame M-Post / stockquote http / 1.1 man: "http://schemas.xmlsoap.org/soap/envelop/"; ns = nnnn content-type: text / xml; charset = "UTF-8" Content-Length: NNNN Nnnn-soapaction: "http://lectrocommerce.org/abc#mymessage" 7. One of the purposes of using SOAP design SOAP in RPC is to encapsulate and exchange RPC calls using XML scalability and flexibility. This section defines a unified representation of remote procedure calls and responses. Although it is expected that this representation is most likely to be used in combination with the encoding method defined in Section 5, there may be other representations. SOAP's EncodingStyle attribute (see Section 4.3.2) can be used to indicate that method calls and answers are used in this section. Use SOAP and SOAP protocol bindings in RPC (see Section 6) is closely related. When using HTTP as a binding protocol, an RPC call is naturally mapped to an HTTP request, and the RPC response is also mapped to the HTTP response. However, using SOAP in RPC is not limited to binding HTTP protocols. To make a method call, the following information is required: the URI method name method of the target object, the parameter header data of the Signature (optional) method (optional) SOAP relies on the protocol binding to provide the mechanism for transmitting the URI. For example, for HTTP, the requested URI points out the source called. In addition to a legal URI, SOAP does not have any restrictions on an address format. (More URI information see [4]) 7.1 RPC and SOAP RPC method calls and answers are included in the SOAP Body element (see Section 4.3), which use the following representation: A method call is used to represent a method call to be seen as a single structure, each [in], and [IN / OUT] parameters have an Accessor. The name and type of the structure are the same as the method. Each [IN] and [IN / OUT] parameters are viewed as an Accessor, this Accessor name and type correspond to the name and type of the parameters. The same order and the parameter sequence defined in the method. A method should reply to a structure. A method response is seen as a single structure, the return value and each [IN] and [IN / OUT] parameters have an Accessor. The first Accessor is the return value, which is then the same as the parameter sequence defined in the method of the parameter Accessor, parameter Accessor. The name and type of each parameter Accessor correspond to the name and type of the parameters. The name of returning value Accessor is not important. Similarly, the name of the structure is not important, but it is usually coupled with the string "response" as the name of the structure after the method name. Method is indicated using the SOAP FAULT element (see Section 4.4). If the binding protocol has additional rules indicating an error, these rules must also be followed. As mentioned above, method calls and response structures can be coded in accordance with rule in Section 5, or specify encoding mode with an EncodingStyle attribute (see Section 4.1.1). Applications can process a request for missing parameters, but it may return an error. Since the return result indicates that the call is successful, the error indicates that the call failed, so it is incorrect in the method response to incorporate the return result and the error is wrong. 7.2 RPC and SOAP Head In RPC encoding, there may be additional information related to method requests related but not, a regular method SIGNATURE. If so, it must be a child element of the SOAP header element. An example of using this head element is to transfer the transaction ID in the message. Since the transaction ID is not part of the method Signature, it is usually controlled by the underlying component instead of application code control, so there is no direct method to pass this necessary information in the call. By adding a given name to the head, the receiver's transaction manager can draw this transaction ID and does not affect the code called by the remote procedure. 8. Security Consider this document does not involve integrity and confidentiality, which will be described in later versions. 9. References [1] S. Bradner, "The Internet Standards Process - Revision 3", RFC2026, Harvard University, October 1996 [2] S. Bradner, "Key words for use in RFCs to Indicate Requirement Levels", RFC 2119, Harvard University , March 1997 [3] E. Whitehead, M. Murata, "XML Media Types", RFC2376, UC IRVINE, Fuji Xerox Info. Systems, July 1998 [4] T. Berners-Lee, R. Fielding, L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax, RFC 2396, MIT / LCS, UCIRVINE, XEROX CORPORATION, A UGUST 1998. [5] R. Fielding, J. Gettys, JC Mogul, H. Frystyk, T. Berners -Lee, "Hypert Ext Transfer Protocol - HTTP / 1.1", RFC 2616, UC IRVINE, DEC W3C / MIT, DEC, W3C / MIT, W3C / MIT, JANUARY 1997 [6] H. Nielsen, P. Leach, S . Lawrence, "An HTTP Extension Framework", RFC 2774, Microsoft, Microsoft, Agranat Systems [7] W3C Recommendation "The XML Specification" [8] W3C Recommendation "Namespaces in XML" [9] W3C Working Draft "XML Linking Language" ............?................. UcTures ". This is work in propress. [11] W3C Working Draft" XML Schema Part 2: Dattype ". this is work in propress. [12] Transfer Syntax NDR, IN" DCE 1.1: Remote Procedure Call "[13] N , N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part ONE: FORMAT OF Internet Message Bodies, RFC2045, Innosoft, First Virtu Al, November 199610. Appendix A. SOAP Package Example A.1 Request Coding Example 5 Similar to Example 1, there is a necessary head POST / stockquote http / 1.1 host: www.stockquoteserver.com content-type: text / xml; charset = "UTF-8" Content-length: nnnn soapaction: "Some-Uri" POST / stockquote http / 1.1 host: www.stockquoteserver.com content-type: text / xml; charset = "UTF-8" Content-length: nnnn soapaction: "Some-Uri" A.2 Answering Coding Example 7 Example 7 Similar to Example 2, but necessary head HTTP / 1.1 200 OK Content-Type: Text / XML; Charset = "UTF-8" Content-Length: nnnn HTTP / 1.1 200 OK Content-Type: Text / XML; Charset = "UTF-8" Content-Length: nnnn Example 9 is similar to the example 2, but the necessary head error HTTP / 1.1 500 INTERNAL Server Error Content-Type: Text / XML; Charset = "UTF-8" Content-Length: NNNN Example 10 and Example 2, but processing BODY error http / 1.1 500 Internal Server error Content-type: text / xml; charSet = "UTF-8" Content-Length: nnnn