The foreground of the service architecture expansion web services, Part 2

zhaozj2021-02-16  95

The foreground of the service architecture expansion web services, Part 2

SOA connection architecture

Level: Junior July 2004

This article continues to detail the service-oriented architecture (SOA). in

Part 1 we discussed the characteristics of SOA. This article discusses the SOA connection architecture - SOA work role: how service requester and service provider communicate, how the service provider specifies the necessary information to integrate the service to the service requestor, and how the service requester finds the service it needs . This article also describes the information exchange mode and compares synchronous and asynchronous exchange.

China's written language is constructed by expressions instead of tag text, even if the words pronounced in dialects are completely different, we can also use written languages ​​to represent all dialects. Although the goal of Qin Shihuang unified speaking is not realized, when the Chinese does not understand each other's speaking, communicate with a general written language.

Web services use a similar approach. XML is a universal data expression. You can use XML as an exchange medium using the programs written in different programming languages ​​and perform different machine instructions. XML is the basis of all web service technology and is the key to interoperability, and each web service specification is based on XML. In particular, SOAP exchanges standardization of information written by XML, and WSDL uses XML vocabulary to describe the details of SOAP.

In the first part of this article (see Resources), define the service-oriented architecture (SOA) and some of its features, and explains its relationship with the web service technology. It can be learned from the SOA is an architectural style that is served by the application and encapsulates the application function to improve reusability.

I describe the web service as an emerging specification, and the Web service is the best way to implement SOA. There are a lot of articles about web services, so I will explain these details based on other articles (see Resources). When I analyze the SOA architecture concept, you will see some content that is obviously repeated with the web service, but the focus of this paper is the prospect of the SOA extended Web service.

Like Web services, service work roles, two key roles in object-oriented architectural (SOA): service requesters and service providers. One or more provider applications provide services by sending request messages and process response messages, requiring these services.

Figure 1. Service requester and service provider

Some service providers are also a service requester: they gather the functions of other service providers to construct a higher level of services. This combination is accomplished by using a special proof language such as Java, C # or as a business process executing language (BPEL).

Figure 2. Polymeric service requester

Some SOA technology like UDDI and WS-TRUST propose a third role called Service Broker. Service agent is an intermediary-service localization between service providers and service requestors, agency hosting scheme, and so on.

Figure 3. Service agent as an intermediary

Entities modeling using these three roles use service calls (Service Invocation, such as SOAP messages).

Service call W3C SOAP 1.2 Specifies to define messages using XML format between service requestors and service providers to communicate. Place the application request (in XML) into the SOAP envelope (also XML), and send an application request from the requester to the provider, and the response sent back by the provider also uses the same form. Most products on the market support early SOAP 1.1 specification, but will support SOAP 1.2 in future product releases. Since there are already many content about SOAP, please refer to the publications listed in the reference.

Figure 4. Service request using SOAP

Soap is the best way to support service calls in the loose interoperability between partners with a separate IT infrastructure, so SOAP is the best way to support service calls. However, SOA does not need to use SOAP.

For example, before SOAP, some companies use IBM? WebSphere? MQ to send an XML document to other computers, and other computers perform application operations based on these documents. The Ebey XML using the HTTPS interface is transmitted to the item entry for auction in a similar manner. Although web services cannot be called because there is no SOAP, the service can still be called in SOA. Of course, WebSphere MQ currently provides direct support for SOAP messages.

As long as all entities are written in Java language, you can create SOA only using available features in J2EE. However, this method does not provide a satisfactory solution for non-Java applications.

Where the IT system control code is required inside the company, you can consider the service calling method other than SOAP, which may not be built and parse XML content. This will have better performance and avoid writing SOAP package code around existing features. For the simplicity of the simplicity, a single call API style that can be used to call the service using other protocols is a good practice.

Multi-Agreement Services call JAX-RPC specification (also called JSR-101) Defining a Java API, making it easy to call Web services from the Java program. The JAX-RPC implementation must at least support SOAP 1.1 for HTTP. However, in order to call it, it may also support other protocols. Multiple protocol service calls can specify different protocols using the same API, such as changing the URL.

The JAX-RPC implementation in the current version of WebSphere Application Server is JSR-101-Compliant, but allows simple to use the SOAP calls on the JMS by modifying the URL to the JMS server (such as WebSphere MQ) addressing. In the near future, this multi-protocol style will allow service calls on the IIOP to enable EJB services to implement valid interoperability.

The key to simplicity is to use the same API without consideration of the agreement. Let this make it possible to describe the capacity of the protocol in WSDL, which is different from SOAP on HTTP.

The Service Description Web Service Description Language (WSDL) specification defines an XML vocabulary that defines a contract between service requestors and service providers in accordance with request and response messages. You can define the web service as software, which provides reusable application functions by describing the WSDL document of the SOAP message interface, and communicating using standard transport protocols.

WSDL describes the necessary details so that service requesters can use specific services:

Request Message Format Response Message Format Send Messages

WSDL is based on XML, so the WSDL document is a computer-readable. This development environment uses WSDL to automatically process the integrated service process to the requester application. For example, WebSphere Studio generates a Java agent object, which can be implemented like a local object, but actually proxy objects only process the request to create and respond to resolution. Regardless of whether the service is implemented with Java, C # or other language, the generated Java proxy object can call any web services from the WSDL description. In fact, WSDL cannot describe the implementation details like programming languages.

Figure 5. Using the WSDL document

WSDL uses its extension and supports service definitions by different protocols on HTTP. Based on SOA, you can refer to any application feature that can be described by WSDL to describe the interface. When SOA does not require WSDL - you can use other service description languages ​​- most manufacturers and products are supported by WSDL. Information exchange mode In the popular request-response (Request-response) exchange mode, the service requestor sends a request message to the service provider (or endpoint). After processing the request, the provider sends the response message to the requester. Service interoperability can be a session, consisting of several requests-responses. However, in order to achieve the simplicity of performance, the design is benefited from the loose coupling, the design of the coarse particle size interface is a good way, which can minimize the number of exchanges required for transactions.

Figure 6. Request - Response Message

In addition to request - response mode, WSDL also defines the following:

Send a single-Way message to the endpoint -, for example, a request that does not need to be responsive: Figure 7. One-way request from the one-way message sent from the endpoint called notifications: Figure 8. Notification requirements - Response (Solicit-Response Model, endpoints send messages and receive responses by it: Figure 9. Requirements - response

At present, SOA implementations typically use HTTP, resulting in synchronous communication - the requester wait for a response before processing. Synchronous exchange for services for the expected completion time relatively short (several seconds or minutes).

It is also possible to have asynchronous service interoperability, and the service requestor does not wait for a response during asynchronous service interoperability, but expects to deliver a response. This is suitable for long-running transactions. For example, call a business process to request a specified passenger aircraft quote, the process includes many partners or people's interoperability, which takes a few days or for a few weeks. Use asynchronous exchanges to avoid losing connections (because server maintenance, etc.) and therefore lose response.

The WS-Addressing specification will use the reply-to address as an extension of the SOAP envelope header element. Services requesters will request the queue to put into the port specified in the WSDL document, but do not wait. On the contrary, before the response arrives, it does other Take a 5 狈  裉峁 咦 阜 阜 ⑺ κ κ 保 ? SOAP's Reply-to address: Request message

Figure 10. Reply-to address in SOAP

When using messages such as WebSphere MQ, you can use JMS to implement synchronization messages. The requester can choose to queue the completion of the queuing but not waiting for processing. When performing other operations, check the response queue in the response queue.

Figure 11. Synchronization message using JMS

You can use the method of synchronization messages to create additional swap modes, such as receiving multiple notification requests (such as notifications in stock quotation.).

Figure 12. Multiple response mode

Service discovery although service calls and service descriptions are often considered to be SOA requirements, service discovery is also its optional feature. UDDI (General Description, Discovery, and Integration) defines a standard interface (Based on SOAP message) for the availability and discovery of the publishing service. The UDDI implementation interprets the SOAP request of the publishing and discovery service as a data management function call for basic data storage.

To publish and discover other web services, UDDI implements service registration by defining standard SOAP messages. Registration is a service agent, which is an intermediary that requires the requester and the provider of the service on UDDI. Once the requester decides to use a specific service, developers typically use the development tools (such as IBM WebSphere Studio or Microsoft® Visual Studio .NET) and access the service by creating the code to send requests and process the response. Figure 13. UDDI mode

Discover services for building SOA applications, and the result is like electronic yellow pages. You can use tools (such as UDDI Browser in WebSphere) to find appropriate services during application design. SOA does not need to use UDDI, but because UDDI is built on SOA to complete its own work, UDDI is a good solution for service discovery.

As mentioned in Steve Graham article "SIX Species of UDDI" (see Refigu), you can use UDDI in a number of different ways. This paper specifically pointed out the use of UDDI within IT organizations, mainly for managing internal services to increase reusability and further facilitating endpoint independence. For example, the location of the required service may be cached in the application. If the service is redeployed into a different server, the service requestor can discover the new location with UDDI and cache it to be used in future. When the UDDI is deployed within, using the UDDI service requestor application will automatically adapted to the change of the service deployment (for example, a change to maintain load balancing).

With the development of UDDI, it will extensive publicly-available services provided by other organizations provided by other organizations in the market model. As we will be discussed in the article on the service-oriented article, UDDI is useful in running the UDDI dynamic selection of services at runtime.

Conclusion This paper discusses the basic elements of SOA and their mutual discovery and interoperability. You create an SOA-based IT architecture by developing a service directory (internal or partner) and writes code to develop new applications. Since the service provider can complete your own work by requesting other services, the layered structure of the service can be used on the design. Although a simple request - the response message model is most popular, you can use other messaging models flexible design systems. WSDL document tells you how to integrate services, UDDI helps you find the service you need.

The next part will discuss service arranging and construct a service and application for other services and applications.

Get the product used in this article If you are developerWorks subscriber, you will have a single user license and have the right to use WebSphere MQ, WebSphere Studio and other DB2?, Lotus?, Rational?, And Tivoli to develop, test, evaluate and demonstrate your application. If you are not a subscriber, you can book it.

Reference

If you want to know more about SOA information and resources, please read "SOA Novice Getting Started" (DeveloperWorks, April 2004). Please read the first part of this article, "Service-oriented architecture expand the foreground of Web services, Part 1" (DeveloperWorks, April 2004). View SOAP 1.1, SOAP 1.2 and WSDL 1.1 specification, as well as WSDL 2.0 draft, all of which are from World Wide Web Consortium. Check Oasis's UDDI 2.0 specification, another basic web service protocol. Check the Web Service Addressing Specification, Web Addressing is a new protocol for providing addressing mechanisms interoperable with messaging layers in standalone transfer mode. Different methods using uddi in the article in Steve Graham, The Role of Private UDDI Nodes in Web Services, Part 1: Six Species of Uddi, And The Role of Private Uddi Nodes, Part 2: Private Nodes and Operator Nodes May 2001). In WebSphere Version 5.1 Application Developer 5.1.1 Web Services Manual Red Books How to use WebSphere Studio to implement messaging. Check out how to define interoperability between web services and business processes in the BPEL 1.1 specification. Please check the JAX-RPC 1.1 specification, the J2EE standard part. To learn more about JOSHY JOSEPHY articles, see Developers' Introduction to JAX-RPC, Part 1 and Part 2 (DeveloperWorks, November 2002 and Jan 2003). Perspectives on Web Services: Applying Soap, WSDL and UDDI TO REAL-World Projects can be reviewed in the book, WSDL AND UDDI TO REAL-World Projects, is available in the book for different participation roles in the web service item (Springer Verlag Publishing, 2003, ISBN 3540009140). Please refer to "Migrate to Service-Oriented Architecture, Part 1" (DevelOperWorks, December 2003) to better understand the value of facing the service architecture. Please refer to the "Transfer to Service-Oriented Architecture, Part 2" (DevelOperWorks, December 2003) to understand why the service-oriented architecture will be the best platform carrying existing information in the future, and why it can be The application is developed quickly and correct.

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

New Post(0)