| By Asim Saddal | Article Rating: |
|
| January 3, 2013 01:00 PM EST | Reads: |
5,165 |
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 5,165
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: Rethink IT and Reinvent Business with IBM SmartCloud
- Session Topics: 12th Cloud Expo / Cloud Expo New York
- Commander of U.S. Cyber Command and National Security Agency Director, General Keith Alexander, To Keynote Day One of Black Hat USA 2013
- Cloud Business Solutions, Social Media, and Platform Systems of Engagement Market Shares, Strategies, and Forecasts, Worldwide, 2013 to 2019
- Cloud Expo New York: Security for Cloud Computing
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- Cloud Expo | IBM & OpenStack Together: Accelerating Cloud Adoption & ROI
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- Cloud Computing – The Perfect Match for Big Data
- Research and Markets: Global Platform-As-A-Service Market Expected To Post Revenue of US$6.45 Billion in 2016 According To Latest Report
- IBM Named “Diamond Sponsor” of Cloud Expo New York
- Cloud People: A Who's Who of Cloud Computing
- State and Local Governments Adopt Microsoft Dynamics CRM to Improve Citizen Service Delivery
- Cloud Expo New York: Rethink IT and Reinvent Business with IBM SmartCloud
- Session Topics: 12th Cloud Expo / Cloud Expo New York
- ACI Worldwide Empowers Financial Institutions to Increase Efficiency of Card Issuing and Account Management
- Cimtrek announces the general release of its Lotus Notes migrator for Microsoft’s SharePoint platform
- Commander of U.S. Cyber Command and National Security Agency Director, General Keith Alexander, To Keynote Day One of Black Hat USA 2013
- Cloud Business Solutions, Social Media, and Platform Systems of Engagement Market Shares, Strategies, and Forecasts, Worldwide, 2013 to 2019
- Cloud Expo New York: Security for Cloud Computing
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- Velocity Technology Solutions Introduces IBM Power Systems Universal Cloud Services at COMMON 2013
- AMAX Launches StorMax(TM) CFS, powered by IBM(R) General Parallel File System(TM) (GPFS(TM))
- Java vs C++ "Shootout" Revisited
- Where Are RIA Technologies Headed in 2008?
- WebSphere Application Server Java Dumps
- Unveiling the java.lang.Out OfMemoryError
- How To Deploy Scalable WebSphere Applications Using "Maven" Build Tool
- Breaking News: New Internal IBM Report Says "Another Flawed Study"
- Profiles for WebSphere Application Server 6.0
- Last Exclusive JDJ Interview With "IBM's" John A. Swainson, Now CA's Newly Appointed CEO
- Automated Deployment of Enterprise Application Updates
- Developing Java and Web Services Applications on Rational Application Developer V6
- Your Guide to Portal Clustering in WebSphere Portal Server 5.1
- How to Create a Simple Java J2ME Application for BlackBerry






















