Integration of SOAP Technology and B2B (1)
Chai Xiaowei
2002-4-26
This article was originally published by the IBM DeveloperWorks China website, its URL is http://www.ibm.com/developerworks/cn/
SOAP technology and application overview
Since XML technology is introduced into B2B e-commerce applications, people have found that XML is indeed a very good and extremely suitable technique in the B2B e-commerce application environment. XML is performed as an Internet environment-based multipoint data exchange fully suits all kinds of business information between multiple enterprises / applications in the B2B e-commerce environment. B2B e-commerce says that low is to allow business messages between enterprises to exchange, and can flow in a series of enterprise applications, and achieve complete B2B electronic information flow, to reduce artificial intervention, improve business operation Efficiency, get more business opportunities.
In order to achieve this, the providers of B2B Solution / Software, such as CommerceOnd, Ariba, etc., which are used to exchange business messages between B2B applications, including CommerceOne XCBL (XML Common Business Library). ), ARIBA's CXML (Commerce XML), Microsoft's BizTalk, etc. These swap formats have been used in numerous B2B applications. In 2000, UN / CEFACT and Oasis jointly started to develop information exchange format EBXML of global e-commerce, fully establishing the status of standard technologies for information exchange in business applications. Using XML to describe business information such that various B2B applications have achieved open integration on the data layer. However, from the perspective of technology, this only completed the minimum level of integration in the application field: data layer integration. The integrated parties must agree on system details outside the data. You must understand the other party's acceptance, network protocol, access portfolio, security requirements, etc., in the module layer, the application layer is still in a phase that is not integrated.
It is to solve the module layer to integrate, interactively, unified, unified ways, IBM, Microsoft, Developmentor, etc., collaborate, to formulate Simple Object Access Protocol (SOAP) specification. SOAP is defined based on XML, completely inheriting XML openness and description scalability. SOAP uses existing TCP / IP-based application layer protocols HTTP, SMTP, POP3, etc., which can be maximized to existing communication technology. SOAP's message path mechanism and expandable header and body mechanism provide good support for distributed computing.
SOAP technology overview
SOAP provides a simple lightweight mechanism for using XML pairs of structured and type information in a loose, distributed environment. SOAP itself does not define any application semantics, such as programming models or specific semantic implementations, it just defines a simple mechanism, expressed semantics by a modular packaging model and a data relocation mechanism encoded in modules. . 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).
The SOAP specification is mainly composed of three parts:
§ SOAP envelope, it constructs a whole SOAP message representation framework, which can be used to indicate what the content in the message is sent, who should accept and handle it, and these processing operations are optional or optional or Must be equal.
§ SOAP Code Rules (Encoding Rules) defines a data coding mechanism to define the data types that need to be used in the application, and can be used to exchange examples derived from these applications defined by these applications. For example, it is possible to order the needs of the order service, using the SOAP coding rule to define the order of the order, and exchange order instances between the client and the order service. § SOAP RPC Representation defines a convention for representing remote procedures calls and responses, such as how to use HTTP or SMTP protocol and SOAP binding, how to transfer process calls, which part of the specific transport protocol In response, if we can pass the process response when the response of HTTP.
Although these three parts are defined as a whole as the SOAP, they are functioning, they are independent of each other. In particular, envelopes and encoding rules are defined in different XML namespaces, which is advantageous to obtain conciseness and implementation of definitions and implementation through modularization.
Since SOAP's main design goals are concise and scalability. 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 Transport / Processing, Objects-By-Reference, Object Activation.
Below I first give an example of using SOAP calling B2B services, let everyone access the B2B service to use SOAP, and finally obtain the interaction of the B2B service and integrate a preliminary and sensual understanding:
In this example, a SOAP request for obtaining the latest transaction price (GetLastProductPrice) will be submitted to the Product Quote service. The request will contain a string type parameter, indicating the product code that needs to be quoted, and in the SOAP response contains a real price. The SOAP envelope element is the root element of the XML document representing the SOAP message. XML Namespaces are used to eliminate possible understanding of understanding between the SOAP identifier and the identifier of the application definition. This example uses SOAP HTTP Bindings, and SOAP messages are always transmitted through a network transfer protocol, so in the subsequent space, I always set up SOAP binding to some protocols, such as HTTP.
POST / PRODUCTE: B2BSERVICE.DEALEASY.COMCONTENT-TYPE: TEXT / XML; Charset = "UTF-8" Content-Length: nnnnsoaPaction: "Some-Uri"
The above SOAP message is a call request. The following SOAP message is called response: http / 1.1 200 okcontent-type: text / xml; charset = "UTF-8" Content-Length: nnnn
SOAP message exchange model
Fundamentally, the SOAP message is a transmission method from the sender to the recipient, but as explained in the previous example, the SOAP message is generally combined with the implementation mode, such as request / response. The implementation of SOAP can be optimized for special features of special network systems. For example, the SOAP response message is transmitted, requested and responded to the same connection with the HTTP response via HTTP Binding.
However, regardless of the SOAP is binding to which protocol binding, the message can be specified by the message path (Message Path), and the message path mechanism allows the message to be in one or more intermediates before reaching the final destination. This is a very useful, and that it is suitable for a mechanism for distributed computing environments. For example, an application order can first reach the account service (AccountAuthentication service) to obtain the latest price for the product price query service (Product Quit Service), then enter the latest order service (PurchaseOrder Service) based on the latest The price produces an order and responds to the caller. Through such a mechanism, the B2B business process implementation based on the modular service design can be implemented, and good system systems and functions are achieved by the unified integration of low coupling modules.
Typically, a SOAP application that receives the SOAP message must be processed by performing the following action:
1. Find and identify all parts that are set for the application in the SOAP message. For example, in the previous example, the AccountAuthentication Service needs to find and identify the account information (Account Info) in the message.
2. Verify that the message that must be processed in the identified portion of the message obtained in the previous step (in the SOAP message specification supports the mandatory processing section and the optional processing section, this function is implemented by the decoration of the document segment Reuting) and processes these parts. If this part of the content does not meet the default definitions of both parties, the message is discarded. The processor can ignore an optional portion in the identified portion obtained in the first step, and if these optional portions do not affect the result of the processing. For example, in the example above, after the first step is completed, the Account INFO is removed in the message, generates a session key, add the SOAP message, and forward the message to the ProductQuote Service.
3. If the SOAP application is not the ultimate destination of the message, the part in the message is removed in the message, and if necessary, the resulting portion is attached, and the message is forwarded. In order to handle a message or message, the SOAP processor needs to understand: use of switching mode (including one-way, request / response, broadcast, etc.), the role of the message recipient, the use method of the RPC mechanism (if some Data, the encoding or representation of the data in the message, and other semantics you must understand for the correct handling.
Example of SOAP message exchange
In order to give everyone a sense of understanding, we will see how the SOAP message should be implemented in conjunction with the example of the previous application order, through the understanding of such a mechanism, we will find that we can completely in such a way. Realize such a service network. AccountAuthentication Service can be located in the CA Certification Center, generated by the authentication center, which guarantees the security by the CA Certification Center; ProductQuote Service is located in a E-Marketplace, general enterprises will release their product information to E-MarketPlace To seek more business opportunities; PurchaseOrder Service can be located in E-Procurement Site, providing this product, so companies can easily modify their procurement processes and orders in the standard framework.
Here is an example of this SOAP message that spans multiple services:
Message I: Request a Purchase Order with Accountinfo and PruductID
POST / AccountAuthentication http / 1.1host: port.ca.com.cncontent-type: text / xml; charset = "UTF-8" Content-Length: nnnnsoaPaction: "Some-Uri"
POST / PRODUCTQUOTE HTTP / 1.1HOST: Service.emarketPlace.com.cncontent-type: text / xml; charset = "UTF-8" Content-length: nnnnsoaPaction: "Some-Uri"
POST / PRODUCTQUOTE HTTP / 1.1HOST: Service.emarketPlace.com.cncontent-type: text / xml; charset = "UTF-8" Content-length: nnnnsoaPaction: "Some-Uri"
HTTP / 1.1 200 OKContent-Type: Text / XML; Charset = "UTF-8" Content-Length: NNNN
This article describes how SOAP technology is integrated with the B2B application in a general open and extensive environment. After everyone has a preliminary understanding of SOAP technology, I will introduce the structure and application of SOAP envelopes in the future, and the relationship between SOAP encoding and other XML patterns and the RPC specification and applications of SOAP.
Reference
Technical specification
UDDI, SOAP, WSDL, XML Schema
2. Development package
MSSoAPKit,