Talking about soap (turn)

Source: Internet
Author: User
Tags garbage collection header http request soap object model stub web services visual studio
August 2001
This paper makes a preliminary introduction to soap, gives a few simple examples, then compares the corba,dcom/com and the difference between soap and soap, and then analyzes the operation mechanism of the simple understanding of the rpc+http+xml, and finally shows the foreground of soap.

One: Why soap is needed?
With the development of computer technology, the environment of modern enterprises is becoming more and more complex, and most of its information system is a complex system with multiple platforms and multiple systems. This requires that today's enterprise solutions have a wide range of compatibility capabilities, can support different system platforms, data formats, and multiple connection modes, requiring that the implementation of the system is loosely coupled, cross-platform, language-independent, unrelated to a particular interface, and provides a web Reliable access to applications.
With the increasing of heterogeneous computing environment, the interoperability of various systems becomes more and more necessary, requiring the system to be able to communicate and share data seamlessly, thus eliminating huge islands of information in Internet environment, realizing information sharing, exchanging data and achieving information consistency. Web services wants to achieve a "web-based seamless integration" goal by enabling different systems to invoke each other in a "software-software Conversation" way, breaking the state of incompatibility between software applications, Web sites, and various devices.
In April this year, the consortium convened its first Web Services symposium to explore the direction in which the world's largest Web services should be developed in order to standardize the new web-based service architecture, during which a "Web services stack" concept was presented, as the following figure shows, Soap plays a very important role in the Web service stack as a very common protocol for XML messaging.

Two: What is soap?
Soap (Simple Object access Protocol) is a simple protocol for exchanging information in a decentralized or distributed environment, an xml-based protocol that includes four parts: Soap Encapsulation (envelop), Encapsulation defines a framework that describes what the content in the message is, who sent it, who should accept and process it, and how to handle them; the SOAP Encoding Rules (Encoding rules), which represent instances of the data types that the application needs to use; A SOAP RPC representation (RPC representation) that represents a contract for remote procedure invocation and response; SOAP binding (binding), which uses the underlying protocol to exchange information.
Although these four parts are defined as a whole as part of soap, they are functionally intersecting and independent of each other. In particular, envelopes and coding rules are defined in different XML namespaces (namespace), making the definition simpler.
The two main design goals of soap are simplicity and scalability. This means that there are some properties in traditional messaging systems or distributed object systems that will not be part of the SOAP specification. For example: Distributed garbage collection (distributed garbage collection), mass-routed messages (boxcarring or batching of messages), object references ( Objects-by-reference (which requires distributed garbage)), Object Activation (collection (activation which objects-by-reference)).
Examples of SOAP messages:
1. The first example illustrates a simple communication message in soap, including two elements that are not SOAP definitions but application-defined: header element Alertcontrol and body block element alert. The header block element consists of two parameters: priority and expires. The body block element includes the actual transmitted information.

2. SOAP communication is related to different protocols at the bottom and different interchange formats, and the following example soap uses HTTP as the underlying communication protocol, which makes it possible to use the Request/response mechanism to transmit information. The soap/http request includes a getlasttradeprice block element that carries a string parameter and a ticker symbol that returns a floating-point number in the soap reply. XML name fields are used to differentiate between soap markers and application-specific identifiers.

3. Example 3 shows the StockQuote SOAP service information, which is an answer message to the request for example 2.

Three: What is the difference between soap and corba,com/dcom?
When soap was just raised, many people questioned: what is the difference between soap and CORBA and DCOM?
  1. CORBA (Common object Request Broker Architecture) Common object Demand Broker architecture is a standard object-oriented application system specification developed by the OMG organization. The object requests proxy orb, Object Services, public facilities, domain interfaces, and application interface components. The core of this is the object request Proxy orb. The Orb provides a mechanism by which an object can transparently emit requests and receive responses. Distributed, interoperable objects can be used to interoperate with Orb constructs. An orb can be viewed as a middleware for establishing a customer/service relationship between objects. Based on the Orb, customers can transparently invoke the methods provided by the service object, which can run on the same machine as the customer, or run on other machines to interact with the customer over the network. The Orb intercepts the request sent by the customer and is responsible for finding the service object that implements the request on the software bus, and then completes the parameter, method call, and returns the final result. CORBA 1.1 was released by the object Management organization in 1991. Interface Definition Language (IDL) and application programming interfaces (APIs) are defined to activate client/server interaction by implementing an Object Request Agent (ORB). The release of CORBA 2.0 in 1994, December, defines how to communicate across different ORB providers.
  2. Com/dcom (Component object model/distributed Component object model) is a distributed Component Object Modeling standard proposed by Microsoft, which supports LAN, A wide area network or even the communication between objects of different computers on the Internet. Based on COM applications, components, tools, and so on, DCOM handles the low-level details of network protocols without having to care too much about the details of the network protocols, so that users can focus on solving the user's requirements. DCOM is located between the components of an application, gluing components together in an invisible way to form a fully functional application.
  3. SOAP and corba,dcom/com comparisons.
    3.1 The first point is that soap does not replace corba,com/dcom, and the three concepts are different. Com/dcom is a component model standard and CORBA is a service standard for distributed applications. CORBA and DCOM establish services for distributed applications that serve objects to perform client-invoked services. SOAP is a communication protocol of distributed object based on XML and HTTP, and it is the protocol of communication between Com/dcom and CORBA objects. In fact, with the interoperability of soap and CORBA's powerful execution capabilities, the two can be well combined. The OMG (Object Management Group responsible for the CORBA specification) is focusing on this development.
    3.2. CORBA applications and DCOM applications do not interoperate, and the two cannot collaborate together. Because ObjRef represents a reference to a running object in the Orpc (object RPC) protocol, in Corba/iiop (Internet inter-orb Protocol), IOR (Interoperable Object Reference) is used to represent an object reference for a server with a commutative interoperable object reference. Unfortunately, IOR and ObjRef cannot be associated. However, the use of SOAP can be implemented on the vertical application level CORBA, DCOM technology level integration, to better integrate corba,dcom as a whole.
    3.3 Soap does not define the semantics of information, quality of service, and internet-based transaction processing. Instead of using XML for message encoding, the correct processing requires the server and the client itself to execute, understand and execute each other's use of the Information Format (ONE-TO-ONE,REQUEST/REPLY,BROADCAST,ETC), The application itself plays a very important role in semantic parsing. Instead, corba,dcom represents the semantics of the transmitted information, using binary encoding for parameters and return values. Any meta information, such as a parameter name or type, is not encoded, but makes it difficult for the mediation to handle the message. And because each system uses a different binary encoding, interoperability between systems is difficult to implement.
    3.4 Although CORBA can be executed on different platforms, DCOM can run on various platforms on Microsoft, but CORBA and DCOM solutions must rely on a single application. For example, if you are running a DCOM server program, all distributed clients will have to run on Microsoft's operating platform. While CORBA can run on different platforms, CORBA interoperability does not extend to higher-level services, such as security and transaction processing, where many of the services provided are not well tuned. DCOM and CORBA are suitable for servers--server communication, but for client-server communication is fragile, especially when client programs are distributed across the Internet.
    3.5 Soap does not try to define all the elements of a distributed system like DCOM, SOAP does not provide distributed class libraries, type security checks, versioning, and so on, soap is at a lower level, somewhat similar to the role of IIOP in CORBA, and DCOM provides some additional Protocol functionality , which is not available in IIOP or soap. However, many. The extra functionality of DCOM is only used when the server-server communicates, and the client-server communication is redundant.

Four: Soap=rpc+http+xml
Soap simple understanding, is such an open protocol Soap=rpc+http+xml: using HTTP as the underlying communication protocol, RPC as a consistent call path, XML as a data transfer format, Allows service providers and service customers to interact with the Internet through firewalls. The description of RPC may not be accurate, because the first idea of soap is to implement the platform-Environment independent and independent, each remote call through the network can be encapsulated through SOAP, including DCE (distributed Computing Environment) RPC Calls,com/dcom CALLS, CORBA CALLS, JAVA calls,etc.
SOAP uses HTTP to transfer XML, although HTTP is not an efficient communication protocol, and XML requires additional file parsing (parse), both of which make transactions much slower than other scenarios. But XML is an open, sound, semantic message mechanism, and HTTP is a wide range of issues that can be avoided with many firewalls, thus making soap widely used. But if efficiency is important to you, you should consider other ways rather than SOAP.
In order to better understand how soap,http,xml work, it may be useful to consider the operating mechanism of com/dcom, DCOM to deal with low-level details of network protocols, such as communication between proxy/stub, lifecycle management, object identification. When the client interacts with the server, DCOM uses the NDR (network data representation) as the data representation, which is a low-level platform-independent representation of data.
DCOM is effective, flexible, but also very complex. One of the main advantages of soap is its simplicity, SOAP uses HTTP as a network communication protocol, accepts and transmits data parameters using XML as the data format, replacing the NDR format in DCOM, and soap and DCOM are similar, as shown in the following illustration, but with XML instead NDRs, as encoded representations, provide a higher level of abstraction, regardless of platform and environment.

When a client sends a request, the request is first converted to an XML format, regardless of the client platform, and the soap gateway can automate the conversion. The SOAP protocol uses a private tag table to ensure that the delivery time parameters, method names, and uniqueness of the return value are used, so that the soap gateway on the server can parse correctly, which is somewhat similar to the com/dcom
The stub in the pile. After being converted to XML format, the SOAP terminal name (the remote Invoke method name) and some other protocol identity information are encapsulated into an HTTP request and sent to the server. If the application requires, the server returns an HTTP reply message to the client. Unlike the HTTP GET requests that are usually made to HTML pages, this request sets some HTTP headers that identify a SOAP service fire that is sent along with the HTTP packet. For example, for an application that asks for a stock price, the server side has a component that provides the current price of a stock, and the component is COM or CORBA built on the server. The client sends a SOAP request to the server to inquire about the stock price. The server relies on a SOAP gateway on the server, invokes the appropriate method using embedded HTML objects, and then passes the resulting price to the client via a SOAP reply.
Five The future of SOAP
The World News Consortium published a simple Object Access Protocol (SOAP) 1.1 version on May 8, 2000, with specific specifications published at the following sites ( A draft proposal for the SOAP version 1.2 was launched on July 9 this year, with specific specifications posted at the following sites ( Members of the Working Group writing SOAP version 1.1 include: DevelopMentor, International Business machines Corporation, Lotus Development Corporation, Microsoft, Userland Software.
The introduction of soap is exciting. It can be believed that with the continuous development of network services, it will greatly change our thinking mode and development model. Now, many large companies have started to support soap development, and last year both IBM and Microsoft released the first batch of implementations for soap. IBM has launched the Apache SOAP Project program, and Microsoft has recently launched the official version of SOAPtoolkit2.0, which includes features such as SOAP's high-level interface and low-level interface, the Messaging object interface, fully supporting the WSDL 1.1 standard, and supporting user-defined type mappings. It also provides rich and complete development documentation and application examples. Moreover, two companies are working on interoperability. It is optimistic to estimate that the age of SOAP interoperability will soon come.
Some of the standards associated with soap:
    1. HTTP 1.0 or greater (Http://
    2. The Core Consortium XML recommendation (HTTP://WWW.W3.ORG/TR/1998/REC-XML-19980210)
    3. The namespace recommendation (Http:// of the XML for the consortium.
    4. XML Schema (

Some of the company's products that currently support soap:
Organization ProductRogue Wavenouveau Orbionaorbix 2000ObjectSpaceVoyagerDigital creationszope, the Python application Serveruserlandfrontier groupware productmicrosoftwindows DNA 2000
Soap is a protocol that has nothing to do with programming languages. In fact, many languages have started to support soap, such as: java,c/c++,vb,c#,perl,php. The following is a list of the execution tools for SOAP in the Java/c++/perl/ada/python environment:
    1. Java: Apache SOAP, DevelopMentor ' s implementation, idooxoap from Zvon
    2. Python: pythonware (client side only)
    3. C + +: Idooxoap from Zvon
    4. Perl: SOAP::Lite
    5. Ada: an ADA implementation
    6. Microsoft Visual Studio: The Microsoft SOAP Toolkit.

    1. Http:// (IBM Inc.)
    2. Company)
    3. of the Consortium)
    6. Http://
    7. (China XML Federation)
In view of soap is the current new technology, the lack of domestic information, mainly reference to some foreign data and IBM and Microsoft related information, the article biased, please give more advice!
Author Introduction
De Zhihua: Senior Software engineer, in-depth research on workflow system, participated in the development of SU-PDM2.0 product data management system based on XML. Currently engaged in Soap/xml research in Shanghai City Yi Fang Company. The author can be contacted by
Original address:

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: 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.