Talk about SOAP

xiaoxiao2021-03-06  89

This article makes a preliminary introduction to SOAP, which gives several simple examples; then compares the connection and difference between CORBA, DCOM / COM and SOAP; then analyzes SOAP simple understanding of RPC HTTP XML operation mechanism; final show SOAP foreground.

One: Why do you need SOAP? With the continuous development of computer technology, the environment facing modern enterprises is increasingly complex, and most of their information systems are multi-platform, multi-system complex systems. This requires a wide range of compatibility, which can support different system platforms, data formats, and a variety of connection methods, requiring the system to be loosely coupled, cross-platform, and language-independent of the system in the Internet environment. And unrelated to a particular interface and provide reliable access to the web application.

As the heterogeneous calculation environment is increasing, interoperability between various systems is necessary, requiring the system to seamlessly communicate and share data, thereby eliminating huge information sharing in the Internet environment, realizing information sharing, Data exchange, meet the consistency of information. Web Services hopes that different systems can call each other with "Software Dialogue", breaking the Software Application, Websites, and Various Devices, and implement "web seamless integration" goals.

In April this year, the W3C Alliance held the first Web service seminar for exploring which direction of W3C should develop to achieve the standardization of emerging web service architecture, and present a "Web Service Stack" concept. As shown in the figure, it can be seen from the figure that SOAP acts as a very common protocol used for XML messaging in the Web Services Stack.

Two: What is soap? SOAP (Simple Object Access Protocol) Simple Object Access Protocol is a simple protocol to exchange information in a dispersion or distributed environment, which is an XML-based protocol that includes four parts: SOAP package (Envelop), package definitions What is the content in the message, who is sent, who should accept and process it and how to handle their framework; SOAP coding rule (Encoding rules), used to indicate an instance of the data type required to use; SOAP RPC (RPC REPRESENT), representing the protocol; SOAP Binding, using underlying protocol.

Although these four parts are part of the SOAP, as a whole, they are defined, but they are functionally intersecting, independent of each other. In particular, envelopes and coding rules are defined in different XML namespaces, which makes it easier to define.

The two main design goals of SOAP are simplicity and scalability. This means that some of the traditional message systems or distributed object systems will not be part of the SOAP specification. For example: distributed garbage collection (Distributed garbage collection), bulk transfer message (Boxcarring or batching of messages), object reference, object activation (Objects-by-reference (which requires distributed garbage collection)) (Activation (which requires objects- BY-REFERENCE)))))))))))))))

SOAP Message Example: 1. The first example clarifies a simple communication information in SOAP, including two elements that are not SOAP definitions but the application defined: header element AlertControl and body block element Alert. The header element includes two parameters: priority and expires. The body block element includes information of actual transmission. (Example 1)

2. The SOAP communication is related to the underlying different protocols and different exchange formats. The following example SOAP uses HTTP as the underlying communication protocol, so that you can use the Request / Response mechanism to transfer information. The SOAP / HTTP request includes a block element of getLastTradeprice, which carries a string parameter and Ticker symbol, returns a floating point number in the SOAP response. The XML name is used to distinguish SOAP flags and application-specific flags. (Example 2)

3. Example 3 shows that the STOCKQUOTE SOAP service information is a response message for the request for Example 2. (EXAMPLE 3)

Three: The difference between SOAP and CORBA, COM / DCOM? When SOAP has just been raised, many people put forward questions: What is the difference between SOAP and CORBA and DCOM?

Corba (Common Object Request Broker Architecture) Public Object Request Agent Architecture is a standard object-oriented application system specification that is developed by OMG organization. Several parts of the object request proxy ORB, object service, public facilities, domain interfaces, and application interfaces. Its core part is an object request proxy ORB (Object Request Broker). ORB provides a mechanism that allows for a transparent request and response by this mechanism. Distributed, interoperable objects can utilize ORB configurations to be interoperable. ORB can be seen as a middleware that establishes a client / service relationship between an object. Based on ORB, customer can transparently call the method of service objects, which can run on the same machine with customers, or run over other machines to interact with customers through 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, then completes the parameters, method call, and returns the final result. CORBA 1.1 is published by the object management organization in 1991. Define Interface Definition Language (IDL) and Apply Programming Interface (API) to activate the interaction of the client / server by implementing the object request agent (ORB). Corba 2.0 issued the implementation of how to span different ORB providers in December 1994 to communicate. COM / DCOM (Component Object Model) is a distributed component object model based on Microsoft, support communication between the LAN, WAN, and even the objects of different computers on the Internet. DCOM-based applications, components, tools, etc., handle low-level detail issues of network protocols, without having to pay too many network protocol details, allowing users to concentrate on solving the problems required by users. DCOM is located between the components of the application, and the components are glued together with the unasual way to form a complete feature application. Comparison of SOAP and CORBA, DCOM / COM. 3.1 It is first pointed out that SOAP does not replace CORBA, COM / DCOM, and the concept of three. COM / DCOM is a component model, CORBA is a service standard for distributed applications. CORBA and DCOM establish a service, service objects to execute client calls. SOAP is a communication protocol based on XML and HTTP distributed objects, which is a protocol for communications in COM / DCOM and CORBA objects. In fact, the two can be combined with SOAP interoperability and CORBA powerful execution capabilities. OMG (Object Management Group Responsible for the Corba Specification) is paying attention to this development. 3.2. CORBA applications and DCOM applications cannot achieve interoperability, both of which cannot be collapsed together. Because in the ORPC (Object RPC) protocol, use ObjRef to represent a reference to run objects; in CORBA / IIOP (Internet Inter-ORB Protocol), use the exchange interoperable object reference to IOR (Interoperable Object Reference) represents a server Object references. Unfortunately, the IOR and Objref cannot be associated. However, using SOAP can be implemented on the vertical application level level integration, which can be better integrated with CORBA, and DCOM is a whole. 3.3 SOAP does not define the semantics, service quality, and Internet-based transaction processing.

Instead, XML is used to encode, the correct process requires the server and the client itself to execute, understand and perform the information formats used in each other (one-to-one, request / reply, broadcast, etc), the application itself is parsing in semantics It plays a very important role. CORBA, DCOM represents the semantics of transmitting information, using binary encoding for parameters and returns. You can encode any meta information such as parameter names or types, but make the intermediary difficult to process messages. Also because each system uses different binary codes, interoperability interoperability is difficult to implement. 3.4 Although CORBA can be performed on a different platform, DCOM can run on various platforms of Microsoft, but CORBA and DCOM-based solutions must depend on a single application. For example, if the DCOM server is run, all distributed clients have to run on the Microsoft's operating platform. Although CORBA can run in different platforms, CORBA interoperability does not expand on higher-level services, such as security and transaction processing, in which case many offered services are not optimized. DCOM and CORBA are suitable for communication between servers - servers, but is very fragile for client-server communication, especially when customer programs are distributed over the Internet. 3.5 SOAP is not like DCOM, try to define all elements of the distributed system, SOAP does not provide distributed class libraries, type security checks, version control, etc., SOAP is in a lower level than it, is a bit similar to IIOP's role DCOM provides some additional protocol functions, which are not available in IIOP or SOAP. However, many. The additional features of the DCOM are only available when communicating between servers - servers. It is redundant for communication between the client-server. 4: SOAP = RPC HTTP XMLSOAP simple understanding, this is an open protocol SOAP = RPC HTTP XML: HTTP is used as the underlying communication protocol; RPC is used as a consistent call approach, XML as a data transfer format, allowed Service providers and service customers communicate interact with the Internet through the firewall. The description of the RPC may not be greatly accurate, because SOAP initial concept is to implement the independence and independence of the platform and the environment, each can be encapsulated by the remote call through the network, including DCE (Distributed Computing Environment) RPC Calls , COM / DCOM CALLS, CORBA Calls, Java Calls, etc.

SOAP uses HTTP to transmit XML, although HTTP is not an efficient communication protocol, and XML requires additional file resolution (PARSE), which makes the transaction are much lower than other solutions. But XML is an open, sound, and semantic message mechanism, and HTTP is a wide range of problems with many firewalls, making SOAP a wide range of applications. But if efficiency is important to you, then you should consider other ways, not to use SOAP.

In order to better understand how SOAP, HTTP, XML work, you may wish to consider the operational mechanism of COM / DCOM, the low-level details of the DCOM processing network protocol, such as the communication between Proxy / Stub, the management, objects of life cycle, object Identification. When the client is interacting with the server side, the DCOM uses NDR (Network Data Repesentation as a data representation, which is a low-level and platform-independent data representation. DCOM is effective, flexible, but it is also very complicated. One of SOAP is that its simplicity, SOAP uses HTTP as a network communication protocol, accepts and transmitting data parameters as a data format, replacing NDR format in DCOM, SOAP, and DCOM execution processes are similar As shown in the figure below, the NDR is replaced with XML as a coding performance form, providing a higher level, and has nothing to do with the platform and the environment.

When the client sends a request, regardless of the platform of the client, first convert the request into the XML format, the SOAP gateway can automatically perform this conversion. In order to ensure the uniqueness of the parameters, method name, return value, the SOAP protocol uses a private markup table, so that the server's SOAP gateway can be parsed correctly, this is a bit similar to COM / DCOM

Piles (stub). After converting into an XML format, SOAP terminal name (remote call method name) and some other protocol identification information is packaged into an HTTP request, and then sent to the server. If the application requires, the server returns an HTTP response message to the client. Unlike the HTTP GET requests that usually on the HTML page, this request sets some HTTP Header, identifies a SOAP service excitation, and the HTTP package is transmitted. For example: For an application in questioning stock price, the server side has components to provide a current price of a stock, and the component is COM or CORBA is built on the server. The client sends a SOAP request to the server asks the stock price. The server relies on the SOAP gateway on the server to call the appropriate method using the embedded HTML object, and then the resulting price will be transmitted to the client through SOAP.

Fives. SOAP foreground W3C published Simple Object Protocol (SOAP) version 1.1 on May 8, 2000, which is published in the following sites (http://www.w3.org/tr/SOAP/). In addition, the draft recommendation of the SOAP Version 1.2 version is launched on July 9 this year, and the specific norm is published on the following sites (http://www.w3.org/tr/SOAP12/). Members of the Working Group written by SOAP Version 1.1 include: Developmentor, International Business Machines Corporation, Lotus Development Corporation, Microsoft, Userland Software.

The launch of SOAP is exciting. It can believe that with the continuous development of network services, it will greatly change our thinking mode and development mode. Now, many big companies have started supporting SOAP development. Last year IBM and Microsoft issued the first batch of SOAP. IBM has launched the Apache SOAP project plan. Microsoft has recently launched the official version of SOAPToolkit 2.0, including some of the features: SOAP high-level interface and low-level interface, message object interface, fully supports WSDL 1.1 standard, support user customization Type mapping, and provide rich and complete development documents and application instances. Moreover, the two companies are working hard to study in interoperability. Optimistic estimates, not long, SOAP interoperability is coming. Some standards related to SOAP:

HTTP 1.0 or greater (http://www.w3.org/protocols/http/ietf-http-ext) The core w3c xml recommentation (http://www.w3.org/TR/1998/Rec-xml-19980210 W3C XML Namespace Recommendation (http://www.w3.org/tr/rec-xml-names). Xml Schema (http://www.w3.org/tr/xmlschema 1/)

Some company products currently support SOAP:

OrganizationProducturerBix 2000 ObjectspaceVoyagerDigital Creationszope, The Python Application ServerUserlandfrontier Groupware ProductMicrosoftWindows DNA 2000

SOAP is an agreement that has nothing to do with the programming language. In fact, many languages ​​have begun to support SOAP, such as Java, C / C , VB, C #, Perl, PHP. The execution tools in the Java / C / Perl / Ada / Python environment:

Java: Apache SOAP, DevelopMentor's implementation, IdooXoap from ZVON Python: PythonWare (client side only) C : IdooXoap from ZVON Perl: SOAP :: Lite ADA: An ADA implementation Microsoft Visual Studio: The Microsoft SOAP toolkit.

Reference

http://www.cn.ibm.com/developerWorks/xml/index.shtml (IBM) http://msdn.microsoft.com/ (Microsoft) http://www.w3.org/tr/soap12 / (W3c alliance) http://www.soaprpc.com/ http://www.webservices.org http://www.soapwebservices.com http://www.xml.org.cn (China XML Alliance)

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

New Post(0)