Welcome!

Eclipse Authors: David Smith, Bob Gourley

Related Topics: Websphere, Java, Eclipse, Apache

Websphere: Article

WebSphere Datapower Configurations for HTTP (GET and POST) Requests

Configuring Datapower services for the browser-based HTTP type requests

The purpose of this article is to describe the steps involved in configuring Datapower services for the browser-based HTTP type requests. The commonly used methods for such requests are either the POST or GET HTTP method.

Datapower Configurations

1. For the testing purpose create a loopback pass-through XML Firewall.

2. Create a new Multi-Protocol Gateway with the following values

Input

Values

Name

HTTPBrowserMPGW

Type

static-backend

Response Type

Non-XML

Request Type

Non-XML

Backend URL

<to the loopback XMLFirewall>

 

3. Create a HTTP Front side handler with the following values

Input

Values

Name

HTTPBrowserFSH

Local IP Address

<setup on one of the Ethernet Interface>

Port

81

Allow Methods and Version

GET (and all the other default values)

4. At the Multi-Protocol Gateway screen, click on the "Advance" tab menu and click on "Process Messages Whose Body Is Empty"

5. Click on Apply.

6. Create the httpReqType.xslt file and type the following. Upload the file on the Datapower

<xsl:stylesheet

xmlns:dp="http://www.datapower.com/extensions"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

extension-element-prefixes="dp"

exclude-result-prefixes="dp"

version="1.1">

<xsl:variable name="reqType" select="dp:variable('var://service/protocol-method')"/>

<xsl:template match="/">

<html><body>

<p>HTTP request submitted using

<b><xsl:copy-of select="$reqType" /> </b> method.

</p>

</body></html>

</xsl:template>

</xsl:stylesheet>

7. On HTTPBrowserMPGW, create a new Policy and named it "HTTPBrowserPolicy"

8. Create a new "Client to Server" rule and configure Match action icon for "* " for URL (match all)

9. Assign a "Convert Query Params to XML" action to the rule (convert-http action)

10. Click "Apply Policy"

11. Create another "Server to Client" rule and configure Match action icon for "* " for URL (match all)

12. Assign a "Transform" action to the rule and assign the "httpReqType.xslt" file.


13. Click "Apply Policy" and then "Close Window". Click on "Apply" at the Multi-Protocol Gateway screen

More Stories By Asim Saddal

Asim Saddal works in the Middleware (WebSphere Application Server, WebSphere Datapower, WebSphere Process Server, WebSphere VE) practice of IBM Software Services for WebSphere.