| By Asim Saddal | Article Rating: |
|
| January 3, 2013 01:00 PM EST | Reads: |
4,924 |
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,924
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
- Cloud Expo New York Speaker Profile: Dave Linthicum – Cloud Technology Partners
- Cloud Expo New York: Cloud Is Changing the Economics of Business
- Best CIO Practices Shared from SHI’s Customers
- Cloud Expo New York: Deploying Hybrid Cloud for Performance and Uptime
- Cloud Expo New York: Delivering Digital Marketing on the Cloud
- Big Data Isn’t About the Database, It’s About the Application
- Cloud Expo New York: Rethink IT and Reinvent Business with IBM SmartCloud
- Cloudant to Exhibit at Cloud Expo & Big Data Expo New York
- BEA Updates WebLogic SOA Portal for Web 2.0 Era
- How to Move Your Oracle Databases to Amazon EC2 Cloud
- The Accessibility of the Cloud
- 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 Speaker Profile: Dave Linthicum – Cloud Technology Partners
- Cloud Expo New York: Cloud Is Changing the Economics of Business
- Cloud Expo New York: How to Use Google Apps Script
- Cloud Computing Bootcamp at Cloud Expo New York
- Rackspace Hosting Named “Platinum Plus Sponsor” of Cloud Expo New York
- Best CIO Practices Shared from SHI’s Customers
- Cloud Expo New York: Why Big Data Is Really About Small Data
- Cloud Expo New York: Deploying Hybrid Cloud for Performance and Uptime
- Cloud Expo New York: Delivering Digital Marketing on the Cloud
- Small Cancers, Big Data, and a Life Examined
- The i-Technology Right Stuff
- The Top 150 Players in Cloud Computing
- Who Are The All-Time Heroes of i-Technology?
- Where Are RIA Technologies Headed in 2008?
- Get the Message
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: Thinking Outside the VC Box
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- Five Reasons Why Web 2.0 Matters



















