| By Asim Saddal | Article Rating: |
|
| January 3, 2013 01:00 PM EST | Reads: |
4,944 |
Create Enterprise Framework Service:
Perform the following steps to create an Enterprise Framework Service, called EnterpriseFrameworkServiceMPGW, in Datapower.
1- Create two loopback Services using XML Firewall:
1.a. ServiceA
1.b. serviceB

2- Create the following 3 files
2.a. Create EnvironmentConfig.xml. This file contains the environment value, so the incoming request is assign to right backend.
2.b. Create EnvironmentConfig.xslt. This XSLT file read value from the EnvironmentConfig.xml and set the environment variable.
|
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dp="http://www.datapower.com/extensions" extension-element-prefixes="dp" exclude-result-prefixes="xalan dp" xmlns:xalan="http://xml.apache.org/xslt">
<xsl:template match="/"> <xsl:variable name="masterConfig" select="document('local:///EnvironmentConfig.xml')"/> <dp:set-variable name="'var://context/wp/environment'" value="normalize-space($masterConfig/config/environment/text())"/> </xsl:template> </xsl:stylesheet> |
2.c. Create EnterpriseFrameworkRouter.xslt. This XSLT file constructs the backend URL by preserving the incoming URI and reading the target host
information from the config.xml of that service.
|
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://www.datapower.com/extensions" extension-element-prefixes="dp" exclude-result-prefixes="dp">
<xsl:template match="/"> <xsl:copy-of select="."/> <xsl:variable name="incomingURI"> <xsl:value-of select="dp:variable('var://service/URI')"/> </xsl:variable> <xsl:variable name="tempVar"> <xsl:value-of select="substring-after($incomingURI,'/')"/> </xsl:variable> <xsl:variable name="serviceName"> <xsl:if test="contains($tempVar,'/')"> <xsl:value-of select="substring-before($tempVar,'/')"/> </xsl:if> <xsl:if test="not(contains($tempVar,'/'))"> <xsl:value-of select="$tempVar"/> </xsl:if> </xsl:variable> <xsl:param name="hostAddr" select="'local:///'"/> <xsl:variable name="remoteURL" select="concat($hostAddr,'/xml/',$serviceName,'/config.xml')"/> <xsl:variable name="environment" select="dp:variable('var://context/wp/environment')"/> <xsl:variable name="config" select="document($remoteURL)" /> <xsl:variable name="serviceDestination"> <xsl:copy-of select="$config/EnterpriseFrameworkDestinationList/serviceDestination[@environment=$environment]"/> </xsl:variable> <dp:set-variable name="'var://service/routing-url'" value="concat($serviceDestination,$incomingURI)"/> </xsl:template> </xsl:stylesheet>
|
3- Upload these files to Datapower
3.a. Create “xslt” folder and upload both xslt files there
3.b. Upload “EnvironmentConfig.xml” to “local:///”

4- Create a Multi-Protocol Gateway (MPGW) named, EnterpriseFrameworkMPGW with:
4.a. Dynamic backend
4.b. Request and Response type to Non-xml

5- Create a front side handler, name it EnterpriseFrameworkFSH and assign port number to “81”

6- Create a new policy, EnterpriseFrameworkPolicy, and add following rules:
6.a. Create a new rule for “Client to Server” and with two Transform actions
6.a.i. Assign EnvironmentConfig.xslt to the first Transform action, make sure the Output set to NULL

6.a.ii. Assign EnterpriseFrameworkRouter.xslt to the second Transform action, make sure Output set to NULL

6.b. Create a new rule for “Server to Client” without any actions
6.c. Overall EnterpriseFrameworkPolicy should look like this:

6.d. Apply the Policy and close the window
7- The EnterpriseFrameworkMPGW should look like this: Save the configuration.

Integrate the Existing or New Services to the Enterprise Framework:
In order to incorporate the existing or new service in to the Enterprise Framework
1- Create folder with the name of the service as a folder name under local:///xml/

2- Create the following config.xml for serviceA
2.a. The config.xml file for serviceA, which contains the IP address or hostname for each environment and the port where serviceA is running
|
<?xml version="1.0" encoding="UTF-8"?> <EnterpriseFrameworkDestinationList> <serviceDestination environment="DEV">http://192.168.136.145:2048</serviceDestination> <serviceDestination environment="QA">http://192.168.136.146:2048</serviceDestination> <serviceDestination environment="PROD">http://192.168.136.147:2048</serviceDestination> </EnterpriseFrameworkDestinationList>
|
3- Upload the config.xml file at “local:///xml/serviceA” folder

4- Create the similar config.xml for serviceB with serviceB’s hosts for each environment and assigned port
|
<?xml version="1.0" encoding="UTF-8"?> <EnterpriseFrameworkDestinationList> <serviceDestination environment="DEV">http://192.168.136.145:2049</serviceDestination> <serviceDestination environment="QA">http://192.168.136.146:2049</serviceDestination> <serviceDestination environment="PROD">http://192.168.136.147:2049</serviceDestination> </EnterpriseFrameworkDestinationList>
|
5- Upload the config.xml file at local:///xml/serviceB folder

6- Every time a new service need to be integrated to Enterprise Framework, a config file need to be created for that service with values
of hostname/IP address and the port number where the service is installed. Nothing needs to be done on the EnterpriseFrameworkMPGW at all.
7- For every incoming request EnterpriseFrameworkRouter.xslt (installed in the EnterpriseFrameworkMPGW) parse the URI and look for the
config.xml file for that service. If the service is not installed then there will be no xml/config file for that service.
Testing / Verification:
1- Enabled the probes on serviceAFW and serviceBFW
2- From the SOAP UI send the following test message for serviceA (http://<hostname>:81/serviceA)

3- You should see the response back

4- From the serviceA probe. Notice the values of inbound-url and outbound-url.

5- Now, send the request for serviceB (http://<hostname>:81/serviceB)

6- From the serviceB probe. Notice the values of inbound-url and outbound-url.

7- From the EnterpriseFrameworkMPGW Probe, you can see the requests are directed to their respective services. Notice the values of inbound-url and outbound-url.

Conclusion:
By implementing the Enterprise Framework Service to any WebSphere Datapower environment, it helps to streamline the development of
new services inside Datapower. Datapower administrators do not need to deal with firewall and network configuration whenever a new
service is implemented on its appliances. The framework also does not allow exposing any additional ports outside the network.
Published January 3, 2013 Reads 4,944
Copyright © 2013 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
- AgileTek, LLC Expands Its AgileConnect (TM) Enterprise Interoperability Service to Address Lean Manufacturing Using Key Partners: Cumberland Group, Pelion and Ultriva
- Nastel Announces Support for Monitoring Business Performance of IBM WebSphere DataPower SOA Appliances
- DataPower Enhances Security and Performance for WebSphere MQ
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.
- Cloud People: A Who's Who of Cloud Computing
- New Relic Q1 2013 Blazes Past Growth Targets and Reaches 40,000 Active Customer Accounts
- Cloud Expo New York: Delivering Digital Marketing on the Cloud
- Cloud Expo New York: Rethink IT and Reinvent Business with IBM SmartCloud
- The Accessibility of the Cloud
- Cloud Expo NY: Best Practices for Delivering Oracle Database as a Service
- Cloud Expo New York: Basics of SSD Technology and Its Use in Cloud
- Session Topics: 12th Cloud Expo / Cloud Expo New York
- Cloud Expo New York: The Big Challenge of Big Data & Hadoop Integration
- What CIOs Need to Know About Enterprise Virtualization
- Measuring the Business Value of Cloud Computing
- Cloud Expo New York: Build Modern Business Applications
- Cloud People: A Who's Who of Cloud Computing
- Cloud Expo New York: Best CIO Practices Shared from SHI’s Customers
- Cloud Expo New York: How to Use Google Apps Script
- New Relic Q1 2013 Blazes Past Growth Targets and Reaches 40,000 Active Customer Accounts
- Cloud Expo New York: Why Big Data Is Really About Small Data
- Small Cancers, Big Data, and a Life Examined
- Cloud Expo New York: Delivering Digital Marketing on the Cloud
- Cloud Expo New York: Requirements of a Cloud Database
- Cloud Expo New York: Rethink IT and Reinvent Business with IBM SmartCloud
- Cloudant to Exhibit at Cloud Expo & Big Data Expo New York
- The Accessibility of the Cloud
- Learn How To Use Google Apps Script
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- JavaServer Faces (JSF) vs Struts
- The i-Technology Right Stuff
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- What's New in Eclipse?
- Where Are RIA Technologies Headed in 2008?



























