SOAP Version 1.2 Chinese Character 2

Source: Internet
Author: User

1.Introduction

SOAP v1.2 provides a simple and lightweight mechanism for exchanging structured and typed information with XML in a loose and distributed environment. SOAP itself does not define any application semantics, such as programming models or specific semantic implementations. It only defines a simple mechanism, the application semantics is represented by a modular packaging model and a re-indexing mechanism for data encoded in specific formats in the module. This capability of SOAP allows many types of systems to extend from message systems to Remote Procedure Calls.

SOAP consists of four parts:

  1. SOAP envelop (SOAP envelope, referSection 4). It constructs and defines an overall representation framework, which can be used to representWhat is,WhoIt should be processed, and this isOptionalOrForce.

  2. SOAP encoding rules (for SOAP encoding rules, seeSection 5Is used to exchange the data types defined by the application.

  3. Soap rpc representation (soap rpc representation, seeSection 7), Defines a convention to represent remote process calls and responses.

  4. SOAP bindingSection 6Defines a Convention to use the underlying transport protocol to exchange SOAP envelopes between nodes.

To simplify this specification, these four parts are functionally orthogonal. In particular, envelope and encoding rules are defined in different namespaces, which facilitates simplification through modularity.

This specification also defines two types of SOAP binding, used to describe how SOAP messages (messages) are extended through the framework with or without HTTP[6](HTTP Extension Framework) HTTP[5]Message transmission.

1.1 Design Objectives

SOAP is designed to be concise and scalable. This means that some features of traditional message systems or distributed object systems will not be included in the core specifications of SOAP. These features include:

  • Distributed garbage collection (distributed garbage collection );

  • Boxcarring or batching of messages );

  • Object reference (objects-by-reference, which must be supported by distributed garbage collection );

  • Activation (Object Reference is required ).

1.2 Symbol conventions

Keyword "MUST", "must not", "REQUIRED", "SHALL", "shall not", "shocould", "shocould NOT", "RECOMMENDED ", "MAY", "OPTIONAL" semantics should refer to RFC-2119[2]. Translated into: "required", "required", "yes", "no", "required", "yes", "no", "yes ", "Should not", "recommended", "yes", and "optional ".

The associated SOAP namespaces, such as The namespace prefix "env" and "enc" used in this article, are located in the following locations :"Http://www.w3.org/2001/06/soap-envelope"And"Http://www.w3.org/2001/06/soap-encoding".

In all the content of this article, the namespaces prefix "xs" and "xsi" are always assumed to be"Http://www.w3.org/2001/XMLSchema"And"Http://www.w3.org/2001/XMLSchema-instance"Associated, which is defined by the XML Schemas specification [10,11.

It is worth noting that the use of other namespaces prefix is relatively random and there is no significant semantic constraint.

If the namespace URI uses the form of "http://example.org/..." or "http://example.com/...", it indicates that this is the URI of some application dependencies or context Dependencies[4].

This specification uses extended BNF (Backus-Naur Form) as the build language, see RFC-2612[5].

The edited annotation uses a yellow background identifier (which may not be displayed on all media) and the prefix "Ednote ".

1.3 SOAP message example

The first example shows a simple notification message represented by SOAP. The message contains a message header "alertcontrol" and a message body "alert", both of which are defined by the application, rather than by SOAP. The message header contains two parameters: "priority" and "expires", which are used to process messages by message transmission intermediary and message recipient. The message body contains actually transmitted messages.

Example 0
<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope">  <env:Header>  <n:alertcontrol xmlns:n="http://example.org/alertcontrol">   <n:priority>1</n:priority>   <n:expires>2001-06-22T14:00:00-05:00</n:expires>  </n:alertcontrol> </env:Header> <env:Body>  <m:alert xmlns:m="http://example.org/alert">   <m:msg>Pick up Mary at school at 2pm</m:msg>  </m:alert> </env:Body></env:Envelope>
Sample SOAP Message containing a header block and a body block

SOAP messages can be bound to different underlying protocols and can be used in many message transmission modes. The following example shows how SOAP is used in an HTTP connection. It fully uses the request/Corresponding Mechanism provided by HTTP (seeSection 6).

Example 1 and Example 2 demonstrate an Example of a SOAP/HTTP request and an Example of a SOAP/HTTP response. The SOAP/HTTP request contains an information block for obtaining the final transaction price (GetLastTradePrice), which contains a simple parameter that specifies the stock code to be quoted. Similarly, similar to the previous example, the XML Element GetLastTradePrice is not defined by SOAP itself. The request's service response also contains a simple parameter, stock price. The SOAP envelope element is the top-level element of the XML document that represents the SOAP message. The XML namespace is used to eliminate possible ambiguity between the SOAP identifier and the application-defined identifier.

Example 1
POST /StockQuote HTTP/1.1Host: www.stockquoteserver.comContent-Type: text/xml; charset="utf-8"Content-Length: nnnnSOAPAction: "http://example.org/2001/06/quotes"<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope" > <env:Body>  <m:GetLastTradePrice         env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"        xmlns:m="http://example.org/2001/06/quotes">    <symbol>DIS</symbol>  </m:GetLastTradePrice> </env:Body></env:Envelope>
Sample SOAP Message embedded in an HTTP Request

Example 2 demonstrates the StockQuote service responseExample 1The SOAP message returned by the request message.

Example 2
HTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8"Content-Length: nnnn<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope" > <env:Body>  <m:GetLastTradePriceResponse         env:encodingStyle="http://www.w3.org/2001/06/soap-encoding"        xmlns:m="http://example.org/2001/06/quotes">   <Price>34.5</Price>  </m:GetLastTradePriceResponse> </env:Body></env:Envelope>
Sample SOAP Message embedded in an HTTP Response

InAppendixProvides more examples.

1.4 SOAP terminology1.4.1 protocol Concept
SOAP

AboutSOAP messageFormat andProcessing rulesSOAP message pathInformation exchange between different applicationsGenerateAndReceiveA complete set of specifications and conventions for the simple control mechanism of the interaction process of SOAP messages.

SOAP binding

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

SOAP Node

AccordingSOAPDefine the complete set of specifications to handleSOAP message. The SOAP node is responsible for complying with the SOAP message exchange rules and providing services to be accessed through the SOAP binding relying on the underlying protocol. Any situation that does not conform to the SOAP conventions will cause the SOAP node to generateSOAP errors(SeeSOAP ReceiverAndS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.