IBM WebSphere DataPower Community Forum IBM Webspere DataPower XI50
October 12, 2008, 03:04:47 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: IBM WebSphere DataPower SOA Appliance Forum - Just Launched come share your knowledge!!! These forums will be a great place to build a community. This site is not associated with IBM.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: XML-Firewall with Dynamic backends..  (Read 387 times)
Eddie
Newbie
*
Offline Offline

Posts: 1


View Profile
« on: March 17, 2008, 10:37:50 AM »

Hi All,

I need to make a XML-Firewall policy with dynamic webservices backends with also dynamic destination ports.

So i make a frontend : 192.168.1.1 port 82 adres.

Then on the backend I have to make SSL connections on different ports.

So in our application i can configure Urls like:
http://192.168.1.1:82/proxy.asp?url=https://xxxx.xxx.com:444/webservice/uri/xxx.asmx
But this can also be http://192.168.1.1:82/proxy.aspurl=https://xxxx.xxx.com:443/webservice/uri/xxx.asmx

So I need to make a XSLT to set the destination URL. I can extract everything behind url= to set as destination and then route the traffic to there but that seems not to work.

When i just use a ssl proxy for one static backend it is work but i like to make something dynamic.

Does Anybody have some example xslt files for dynamic backend routing or tips and tricks how to do this..

Thnx.
Eddie
Logged
vijayramkumar.d
Newbie
*
Offline Offline

Posts: 6


View Profile Email
« Reply #1 on: April 09, 2008, 11:31:41 AM »

hi

Please post the log message so that we can look in to ur exact problem
Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #2 on: April 16, 2008, 09:33:07 AM »

One way to do it is to get the URL to a DP variable using a stylesheet, and use that variable in a Route action for the WS-Proxy.

You can configure an SSL proxy and use it in the Route Action as well. If the url is a non-SSL one, Proxy will not be used.

Regards,
Sinu
Logged
vijay.akula@gmail.com
Newbie
*
Offline Offline

Posts: 3


View Profile Email
« Reply #3 on: July 22, 2008, 07:14:04 AM »

If you are still looking for the solution, the content based routing may be applied for your situation. Use the router action then using XPATH expression make a decision to route the request to the appropriate backend URLS.

Logged

Vijay Akula,
Application Designer,
Wellington, New Zealand
+64211800129
zachahuy
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #4 on: September 19, 2008, 04:32:44 PM »

Another solution is to customize it like the stylesheet below. This mimics the idea of a web server where the routing path is dependent on the plugin. The plugin contains the path, and the actual URL. The stylesheet works by searching for the path on the plugin, then extract the routing url and sslproxy if ssl is needed from that path element.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
    xmlns:dp="http://www.datapower.com/extensions"
    xmlns:dpconfig="http://www.datapower.com/param/config" extension-element-prefixes="dp"
    exclude-result-prefixes="dp dpconfig">
    <!-- Author: Huy Huynh zachahuy@gmail.com -->
    <!-- The purpose of this stylesheet is to do dynamic routing -->
   
    <xsl:template match="/">
        <!-- load routes document -->
        <xsl:variable name="RouterMap" select="document('local:///Router-443Map.xml')"/>
        <xsl:variable name="uri" select="dp:variable('var://service/URI')"/>
        <xsl:message dp:priority="debug"><xsl:value-of select="$uri"/></xsl:message>
        <xsl:variable name="route">
            <xsl:copy-of select="$RouterMap/routes/route[@uri=$uri]/routingURL" />
        </xsl:variable>
        <!--<xsl:message dp:priority="debug"><xsl:value-of select="$route"/></xsl:message>-->
        <xsl:variable name="sslid">
            <xsl:copy-of select="$RouterMap/routes/route[@uri=$uri]/sslProxyProfile"/>
        </xsl:variable>
        <!-- copy input to the output since this is last action in the rule -->
        <xsl:copy-of select="."/>     
        <!-- set backend routing variable -->
        <xsl:if test="string-length($sslid) &gt; 0">
            <dp:set-variable name="'var://service/routing-url-sslprofile'" value="$sslid"/>
        </xsl:if>
        <dp:set-variable name="'var://service/routing-url'" value="$route"/>
    </xsl:template>
</xsl:stylesheet>


-----------------------------------------
plug in xml which can be externalize for the cluster to share

<?xml version="1.0" encoding="utf-8"?>
<routes>
    <!-- xwww33aetnacom.xml  Router map for External-80 MPGW use to route external traffic coming through port 80 -->   
    <route uri="/v1/services/WestAddressSearch">
        <routingURL>http://somehostname:3000/services/WestAddressSearch</routingURL>
        <sslProxyProfile/>
    </route>
       
    <route uri="/v1/services/EastAddressSearch">
        <routingURL>http://canalsobehostalias:3001/services/EastAddressSearch</routingURL>
        <sslProxyProfile/>
    </route>

    <route uri="/helloworld">
        <routingURL>http://canalsobeloadbalancerobject:16651/helloworld</routingURL>
        <sslProxyProfile>SomeSSLProxyForHTTPS</sslProxyProfile
    </route>

    <route uri="/healthcheck">
        <routingURL>https://127.0.0.1:90/healthcheck.xml</routingURL>
        <sslProxyProfile>SomeSSLProxyForHTTPS</sslProxyProfile
    </route>
   
</routes>
« Last Edit: September 19, 2008, 04:37:04 PM by zachahuy » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  



Powered by SMF | SMF © 2006-2007, Simple Machines LLC
Seo4Smf © Webmaster's Talks
This Site is not associated with IBM