| By Asim Saddal | Article Rating: |
|
| January 3, 2013 01:00 PM EST | Reads: |
5,174 |
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,174
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
- NIST to Sponsor FFRDC Widespread Adoption of Integrated CyberSecurity
- Cloud Business Solutions, Social Media, and Platform Systems of Engagement Market Shares, Strategies, and Forecasts, Worldwide, 2013 to 2019
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- Altova Announces General Availability of RaptorXML
- Cloud Expo New York | Big Data: What It Means for Legal & Risk Management
- Reflections on the Future of Platform as a Service (PaaS)
- 2013 - 2016 : solutions stabilisées, usages innovants généralisés
- Big Data Will Revolutionize Learning
- Cloud Expo New York: Getting to the Promise of Big Data
- Cloud Expo New York: Cloud Architecture and Engineering
- Cloud People: A Who's Who of Cloud Computing
- Portable Experimenter’s Platform, Powered by Raspberry Pi
- Predixion Software Announces General Availability of the Latest Version of its Predictive Analytics Platform
- Cloud Expo New York: The Big Challenge of Big Data & Hadoop Integration
- NIST to Sponsor FFRDC Widespread Adoption of Integrated CyberSecurity
- Cloud Business Solutions, Social Media, and Platform Systems of Engagement Market Shares, Strategies, and Forecasts, Worldwide, 2013 to 2019
- Agile Solutions for Cloud, Big Data, Mobility Services
- MicroStrategy Announces General Availability of MicroStrategy 9.3.1
- Cloud Computing: Cutting Costs, Boosting Profits
- AMAX Launches StorMax(TM) CFS, powered by IBM(R) General Parallel File System(TM) (GPFS(TM))
- HotLink Debuts Amazon EC2 Plug-in for Microsoft SCVMM with Latest Release of HotLink Hybrid Express
- Benefits of Cloud Computing
- The Top 250 Players in the Cloud Computing Ecosystem
- Web Services Using ColdFusion and Apache CXF
- Cloud People: A Who's Who of Cloud Computing
- Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
- Cloud Expo New York Call for Papers Now Open
- Eclipse "Pollinate" Project to Integrate with Apache Beehive
- An Introduction to Ant
- Cloud Expo 2011 East To Attract 10,000 Delegates and 200 Exhibitors
- Beehive Code Now Available in Apache
- 4th International Cloud Computing Conference & Expo Starts Today
- Apache's Tomcat 5.5 is First Release Ever to Use Eclipse JDT Java Compiler
- "Beehive" Now Officially an Open Source Project: Apache Beehive



















