Tutorials to .com

Tutorials to .com » Software » Engineering » Webservice » WebSphere DataPower with the realization of Hessian Client Access Web services standards

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Print View , by: iSee ,Total views: 14 ,Word Count: 5620 ,Date: Sat, 23 May 2009 Time: 12:38 PM

Before the start of

On the course

This tutorial describes in detail how to install, configure and use WebSphere DataPower achieve Hessian Client Access-based SOAP / HTTP for Web services standards. We will achieve the Hessian to download the API package deal to write a simple Hessian client, then use the WebSphere Transformation Extender Design Studio to generate the standard Hessian information and the type of SOAP message tree and mapping rules, and finally uploaded to WebSphere DataPower, so the use of DataPower Hessian agreement for the gateway and the SOAP message protocol conversion.

Target

This course presents a Hessian protocols and standards to resolve SOAP protocol conversion mode, Websphere Data power With a strong and efficient message format conversion capability, the gateway to achieve an agreement.

In this tutorial, you will be able to learn

What is the Hessian agreement?

How to build a Hessian protocols and standards of the Gateway protocol SOAP?

How to configure and use WebSphere Transformation Extender Design Studio to create the type of tree and mapping rules for testing?

How to configure and use as a run-time Data Power of the Protocol Converter?

Prerequisite

This course presents a solution to transform the Hessian specific SOAP agreement protocols and standards to support the Hessian does not need to amend the original client code access to standard Web services. So this tutorial can be used as Enterprise architect and designer of the reference program. At the same time, the Guide also details the specific example of configuration, and testing the use of WebSphere Transformation Extender and Data Power, the procedure can be used as a reference manual developers.

After reading this tutorial, you should understand the basic java programming, as well as SOAP / HTTP for the development and deployment.

If you need hands-depth understanding and practice, you'll need to

Reference resources to the Web site to download java to achieve Hessian agreement and the preparation of a simple example of the realization of Hessian and Hessian client service, you will find that the use of Hessian is very simple and easy to develop.

Download IBM and the IBM WebSphere Transformation eXtender (WTX) 8.1 Design Stuido try to transform the rules of how to create

Reference resources to the Web site to learn more knowledge on Data Power.

Agreements and Products

Web services technology platform is the solution to heterogeneous systems integration and interoperability issues are mainstream technology, it is based on xml to exchange data on the Internet de facto standard, Simple Object Access Protocol (SOAP) is a simple protocol based on XML, provides a RPC standard way to call the Web service, will enable applications exchange information over HTTP.

By contrast, Hessian protocol is a lightweight remote procedure call (RPC) protocol model, which is based on HTTP protocol transmission of binary encoded message, Hessian protocol is also known as HBWSP (Hessian Binary Web Service Protocol). Hessian is a lightweight, custom description of the binary RPC protocol data to text format for encoding binary data, with only one character as a structure of tags, with the advantage of efficient and simple. Hessian protocol and Web service of the SOAP protocol used is similar to the agreement message is encapsulated in HTTP packets through the HTTP channel for transmission. Hessian protocol data package is smaller than the incremental data package SOAP incremental, and it's the structure of a simple marker of a decrease of encoding, decoding operation on the memory usage. Thus, Hessian protocol in some scenes under a wide range of applications.

DataPower is the IBM service-oriented architecture for (SOA) are another important product launch. DataPower product family includes three products: WebSphere DataPower XA35, WebSphere DataPower XS40 and WebSphere DataPower XI50. XI50 which focus on enterprise information and application integration bus, to support cost-effective mainframe, wire-speed Enterprise Messaging Bus and Enterprise application Integration. DataPower information in different formats (including binary formats, legacy formats and xml format) to convert between, and provide message routing and security. DataPower's DataGlue engine direct support WebSphere Transformation Extender definition format and rules to generate different message format conversion rules can be adopted by the WebSphere Transformation Extender to generate Design Studio, and then uploaded onto DataPower implemented, in order to achieve arbitrary data format conversion between .

IBM WebSphere Transformation eXtender (WTX) Design Studio provides an application used to create integrated solutions for the rich feature set of the client interface. Which, WebSphere Transformation Extender Type Designer is the component object modeling data, it can create and manage the data structure used to define the type of tree attributes and define the data binding and validation rules; and to provide the Map Designer is used to specify data conversion and transfer rules functions, as well as analysis and testing of the compiler has been developed to provide the mapping environment. Design Studio Design by transformation rules can be directly deployed to carry out the implementation of DataPower, the main process involves the use of Type Designer definition and objectives of the source data structure, use the Map Designer to define a conversion rule, and then to generate the data structure and transformation rules on the deployment of DataPower.

Scene Description

Customer needs

The real demand from customers, the client is a mobile service provider, and its early adoption of Hessian agreement of the various business services to end users through the Hessian protocol, cell phone use can be easily initiated by a request to the server and results. The company gradually shifted With the SOA architecture, Web services standards developed by the company's services as a standard, many applications through a standard Web services expose services through SOAP protocol client to access these services. In addition the company expects early Hessian-based application development services to outside client, but also be able to provide some standards for Web services client using the Hessian mobile customers. Therefore, the company expects to serve the gateway through the bus or ESB (Enterprise Service Bus) way to achieve integration in a simple way to the standard SOAP-based Web services into a service agreement based on the Hessian available to those using the Hessian client users, without having to modify the original process of Web services and existing Hessian client, as shown in Figure 1.

Figure 1. Hessian Client Access Web services standards

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Solutions

Web Services Gateway achieve a number of programs, such as WebSphere Message Broker can achieve the gateway into the agreement, but in this application scenario, the telecommunications business-to-service applications require high efficiency, and conversion of data format more flexible and efficient. In these areas, WebSphere Data Power has natural advantages, to achieve hardware acceleration level.

In the solution to achieve Web services gateway products are used in IBM WebSphere DataPower SOA Appliances (hereinafter referred to DataPower) and IBM WebSphere Transformation eXtender (WTX). Which use DataPower as a Web services gateway run-time, use the WebSphere Transformation Extender to establish a binary format and xml format of the mapping between the relations, from the realization of the standard Hessian client access to Web services.

Example

In order to clearly describe in detail the solution, we serve as a simple example, the service provides an Add service to the request to add two integers and then sum the results back to the client.

The scene is a client terminal using the Hessian protocol on methods and parameters were based on the Hessian binary protocol encoding rules, send a request, and then results. For example, a simple request add (2, 3), the Hessian client to send the contents of the agreement such as the one shown in the list.

List 1. Hessian client request message

c x01 x00
m x00 x03 add
I x00 x00 x00 x02
I x00 x00 x00 x03
z

Hessian agreement and return the results of the content is very simple, such as a list of 2 below:

List 2. Hessian information in response to client

r x01 x00
I x00 x00 x00 x05
z

The scene is a standard server-side Web server, provides a standard SOAP-based web service that provides an Add method and the Hessian examples of the same features, but the name for the Sum. (The Web service WSDL file content please refer to the code to download the WSDL file). The Web service request message such as a list of 3 below:

List 3. Sum service SOAP request message

<SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SumRequest>
<First>2</First>
<Second>3</Second>
</SumRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Return the corresponding SOAP message as follows:

The list 4. Sum service SOAP response messages

<SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SumResponse>5</SumResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Configuration steps

The use of this tutorial WebSphere Transformation eXtender Design Studio 8.1 and WebSphere DataPower SOA Appliances products of the two solutions. Steps are:

First of all, in the WebSphere Transformation eXtender Design Studio 8.1 to do some configuration to use DataPower as a run-time servers, so that the rules generated WTX can run DataPower.

The use of WebSphere Transformation eXtender Design Studio 8.1 Create Hessian request and response messages of the type of tree, and the SOAP request message and the SOAP message in response to the type of tree, and then established between the two types of tree mapping rules and mapping rules can be tested.

Upon completion of mapping rules to preach to the type of tree and the mapping file uploaded to DataPower, and then configure the Data Power to create Multi-Protocol Gateway message format to achieve two of the mapping, the final test.

In this tutorial will be back in the configuration steps above, step-by-step detail.

Configure WebSphere Transformation Extender Design Studio to use DataPower as a run-time server

WTX Design Studio to make the conversion rules to generate DataPower be able to run, WTX Design Studio must be run-time server settings for DataPower. In the WebSphere Transformation Extender Design Studio's menu bar, open "Tools -> Options" in the options window to find the bottom DataPowerMaps, then you can set the IP and port DataPower, as shown in Figure 2, click "OK" complete the configuration.

Figure 2. DataPower parameter settings

WebSphere DataPower with the realization of Hessian Client Access Web services standards

WTX Design Studio and then in the menu bar select "Map -> Settings", select the bottom of the "MapRuntime" for "WebSphere DataPower", to be re-running the server DataPower, the default is "WebSphere Transformation Extender".

Figure 3. WTX run-time server settings

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Click "OK" to complete the set.

To create the type of tree and conversion rules

Upon completion of WebSphere Transformation Extender Design Studio configuration, the following is to create a Hessian and the type of XML message tree, the Hessian binary messages, as well as the corresponding XML messages to WebSphere Transformation Extender type described in the form of the tree, and then in the type of tree establish a mapping relationship between the request message to the Hessian binary XML format for mapping the contents of the message. In contrast, the same need to return to the news sources of the XML format map of the Hessian binary format.

Hessian request message to create the type of tree

1 in accordance with the request of a list of news and Hessian coding rules, to create the type of request message tree, as shown in Figure 4

Figure 4. Create a request message Hessian

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Call one of the highest-level component is the component, set its initial value at the nominal value for the word "c <<001>> <<000 >>",(<<*>> that is binary characters), the end of the word at face value the value of "z".

Only in the Call Component Method components, Method method defined components and parameters and other elements of its initial value of the word at face value "m". Right-click MethodLength components, select the "size have been identified," said MethodName the length of the back of MethodLength components by the specified value, which could be WebSphere TX is also very convenient for those uncertain of the definition of the contents of one of the strengths of the news.

SOAP request message to create the type of tree

In the WebSphere TX Type Designer, you can directly import XML Schema, DTD, COBOL Copybook style and other documents to generate the tree. According to a list of the Hessian in a request message is converted to the XML format of the request message as follows:

List of 5. Request message format of the XML message

<add>
<First>3</First>
<Second>2</Second>
</add>

XSD file to describe its style as follows:

List 6. XML request message definition of the Schema

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Add">
<xs:complexType>
<xs:sequence>
<xs:element ref="First"/>
<xs:element ref="Second"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="First" type="xs:integer"/>
<xs:element name="Second" type="xs:integer"/>
</xs:schema>

Open the WebSphere TX Type Designer, select the menu "tree -> Import" to open the type of Import Wizard:

Figure 5. WTX Import XML Schema

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Select "XML Schema", click "Next", select the XSD file to import "XMLRequest.xsd". Prompt and then follow the wizard step by step click the "Next" button to complete the import work, to generate the type of the corresponding document tree.

Figure 6. To create XML request message type tree

WebSphere DataPower with the realization of Hessian Client Access Web services standards

In the Hessian and SOAP request message of the type of trees to create mapping rules

Open the WebSphere TX Map Designer, the establishment of a mapping project, the name for Hessian2XML. Among them, the set input source card object for the type of tree "HessianRequest.mtt", click the type of a column, select the type of "Call", set the file path for the "HessianSampleAddRequest.txt", its content is a list of 1 Hessian request message, after the completion of the input card settings shown in figure 7:

Figure 7. Hessian2XML input card settings

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Similarly, edit the output card, the card output settings for the type of tree "XMLRequest.mtt", type "Doc", output "XMLSampleAddOutput.xml" file, which currently is empty, the conversion rules in the test, the conversion content will be entered into the file, edit the contents of the output card shown in Figure 8.

Figure 8. Hessian2XML output card settings

WebSphere DataPower with the realization of Hessian Client Access Web services standards

The next step is to establish the source and destination of the mapping relations between the source of the First, Second in IntergerType to the target, respectively, into the AddElement the First and Second Rules object, and then the other part of the rules need to set up right Click to select "Insert NONE", set the mapping rules as shown in Figure 9.

Figure 9. Hessian2XML set of mapping rules

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Relations in the map after the menu bar, select "Map -> construct (B)" option, no errors occur, then build a mapping relationship between the success of the final mapping project as shown in Figure 10.

Figure 10. Hessian2XML mapping project

WebSphere DataPower with the realization of Hessian Client Access Web services standards

DataPower tested in the mapping rules to generate

After the success of building a relationship mapping, the next step is to test the DataPower newly created objects and mapping relations in Figure 2 and Tu, we have set up a server run-time for DataPower and set the relevant parameters. Now on the menu bar select "Map -> run", the format is related to the definition and mapping on the DataPower upload operation, if successful, will return to the "Mapping has successfully completed" message.

Figure 11.DataPower on the successful outcome of the mapping

WebSphere DataPower with the realization of Hessian Client Access Web services standards

To the project directory to find XMLSampleAddOutput.xml-generated document, which reads as follows, is the message we need XML.

List of 7. Generated XML request message

<?xml version="1.0" encoding="UTF-8"?>
<Add>
<First>2</First>
<Second>3</Second>
</Add>

Thus, the request message to the type of trees between the Hessian of the mapping between the XML format has been completed successfully.

To create and test the type of message to return to the tree and mapping rules

With the same request message, the same type of information to create the return of trees and mapping rules, a different set of this mapping, the input message format is XML, the output of the Hessian is a binary message format. Specific message format can refer to files attached to this tutorial, after the completion of the mapping rules in response to news of the settings as shown in Figure 12:

Figure 12. The mapping rules in response to the news item

WebSphere DataPower with the realization of Hessian Client Access Web services standards

In the establishment of DataPower between Hessian and SOAP Gateway

Successfully generated in the object tree and the Hessian and the mapping relationship between XML, the next step is to establish in the ESB gateway DataPower achieve Hessian <-> XML <-> SOAP message mapping between the Hessian sent by the client SOAP in the form of binary message sent to the Web service provider, and then the results returned to the Hessian client.

Upload the relationship between the type of tree and mapping the documents to the DataPower

In a browser, type https: / / <ip_address>: <port> / login.xml, enter your user name, password, select the corresponding domain, log in to the DataPower, and then click "File Management" icon.

Figure 13. DataPower selected in File Management

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Open the "File Management", click "Local" option corresponding to "Actions", choose "Upload Files", just the request message to generate the required conversion HessianRequest.mts, XMLRequest.mts, Hessian2XML.xml documents, as well as conversion required to return to the news HessianResponse.mts, XMLResponse.mts, XML2Hessian uploaded in DataPower.

Figure 14. On the type of trees and set out the relevant documents to the mapping of DataPower

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Create Multi-Protocol Gateway

In the Control Panel, click "Multi-Protocol Gateway" icon, enter the "Multi-Protocol Gateway" configuration menu, click "Add" button to create a new Web Service Gateway.

Figure 15. The establishment of a new "Multi-Protocol Gateway"

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Figure 16 shows, the "Multi-Protocol Gateway" is set to the name "HessianSample", enter the Sum Web services provided by the server address to the "Backend URL", amend the request and response messages of the type of "Non-XML".

Figure 16. Settings "Multi-Protocol Gateway"

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Click on "Front Side Protocol" under the "Create New" button to create a new named "HessianBroker" the HTTP Front Side Handler.

Figure 17. To create a new HTTP Front Side Handler

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Click the "Multi-Protocol Gateway Policy" under the "+" button to create a new "Multi-Protocol Gateway Policy" rules, which define how to handle the request and response messages.

Policy to deal with amendments to the rules from the client to the server, from above into the Rule icon in the "Advanced" icon, double-click to modify its properties to "Transform Binary", as shown in Figure 18.

Figure 18. Configuration Transform Binary conversion rules

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Click "Next" button to configure the Transform Binary operation. Can see that the allocation has been changed to "Use XSLT specified in this action on a non-XML message", indicated that the treatment of non-XML messages. In "WTX Map file" option, type "local: / / / Hessian2XML.xml" file, which has been in operation in front of the local upload directory DataPower, the attention of local after 3 "/" backslash .

Figure 19. Transform Binary operation configuration

WebSphere DataPower with the realization of Hessian Client Access Web services standards

The next step is to configure the information to the SOAP message XML conversion, drag the column in the rules "Transform" icon you just created to "Transform Binary" rules, click the icon to open the configuration shown in Figure 20 interface.

Figure 20. Configuration Transform operation

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Click the "Processing Control File" next to "Upload" button to upload documents to the DataPower in XML2SOAP.xsl set "Processing Control File" documents XML2SOAP.xsl. The role of the file format is XML input message is converted to the corresponding SOAP message,

A list of 8. Generated SOAP request message

<?xml version='1.0' ?>
<xsl:stylesheet version="1.0"
xmlns:xsl=http://www.w3.org/1999/XSL/Transformxmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/">
<xsl:template match="/">
<SOAP-ENV:Envelope xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SumRequest>
<First>
<xsl:value-of select="Add/First"/>
</First>
<Second>
<xsl:value-of select="Add/Second"/>
</Second>
</SumRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</xsl:template>
</xsl:stylesheet>

After the completion of the request to configure the following rules as shown in Fig. The rules, first Hessian binary file is converted to XML text format and then converted to SOAP format.

Figure 21.Hessian2SOAP rules request

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Similarly, the server generates the corresponding response to the client message processing rules, as shown in Figure 22. First of all, the adoption of the rules of "Transform" operation, use XML2SOAP.xsl document back to the server SOAP response message mapping for the XML message, and then through the "Transform Binary" operation, use the XML message mapping XML2Hessian.xsl for Hessian binary binary information.

Figure 22. SOAP2Hessian rules in response to

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Thus, Hessian client to the SOAP server-side gateway on the establishment of the ESB project is completed.

Testing Multi-Protocol Gateway

In order to verify the newly generated ESB gateway can be a Hessian client request, and then verify the received response; curl tool can also be used to send request message containing the contents of Hessian to the ESB Gateway, and then verify the information received.

DataPower provides a good debugging tools can help users to verify whether the output of every step of the definition in line with their own rules, just created to open the Multi-Protocol Gateway, click the "Show Probe", the pop-up Probe Configuration window, click "Enable Probe "The details of the request message will be recorded DataPower for debugging use.

Send a list of the Hessian in a request, just click to open the Probe window "Refresh" button, then just send a request, as shown in Figure 23:

Figure 23. Request message content Probe

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Click "View" under the small magnifying glass icon, it shows every step of the message content, as shown in Figure 24,25,26.

Figure 24. DataPower The Hessian request has been the source of information

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Figure 25. DataPower after conversion to XML of the request message

WebSphere DataPower with the realization of Hessian Client Access Web services standards

Figure 26. DataPower converted to the SOAP request message after the

WebSphere DataPower with the realization of Hessian Client Access Web services standards

The same method can also check the news in response to the output of each step in order to verify the handling of response messages is correct.

Concluding remarks

DataPower services as a powerful gateway to support the HTTP, SOAP, MQ, FTP, IMS and other agreements, through a combination of WebSphere Transformation Extender can be achieved in any format conversion between the news. This tutorial describes how to build an easy to use DataPower gateway ESB, through WebSphere Transformation Extender, can define the Hessian binary format and XML format conversion between the rules, and then through the realization of DataPower binary format and XML format conversion between the news in order to a simple and efficient way to achieve the Hessian client for the use of standard Web services SOAP protocol visit.

Figure 27. The expansion of the use of this tutorial - DataPower support multiple client

WebSphere DataPower with the realization of Hessian Client Access Web services standards

In addition, from the Guide to the expansion of open, DataPower also supports Web2.0 agreement, it is easy to create additional standard client access to Web services. In addition to client-side SOAP and Hessian client, but also can be AJAX, REST and ATOM Reader such as Web2.0 client. Through the DataPower, can be easily exposed to the background for these services client access, or the realization of these agreements in accordance with the demand for mutual conversion between.


Web Service Software Factory Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.