Asynchronous BPEL process callback can be secured using OWSM in one of the following 2 ways.
1. Using server side gateway only
2. Using server agent and client side gateway
In either of the solution the key thing to do is to change the WS-Addressing ReplyTo header to point to a virtualized endpoint of a gateway.
1. Using server side gateway only
In this deployment, you only have server side gateway protecting BPEL process. Follow these steps to secure the callback.
- Register web service in the gateway (e.g. SID0003001)
- Register callback in the gateway (e.g. SID0003002)
- Add XML transform step in policy pipeline for SID0003001 that transforms ReplyTo WS-Addressing header to SID0003002
2. Using server agent and client side gateway
In this deployment, you don't have any gateway on server side. Instead the BPEL proecess is being protected using OWSM server agent. Follow these steps to secure the callback in this case.
- Register callback in the client gateway (e.g. SID0003002)
- Add XML transform step in request policy pipeline for server agent that transforms ReplyTo WS-Addressing header to SID0003002
Add an "XML Transform" policy step to the request pipeline on server gateway or agent with the following contents. Remember to modify it to suit your component id.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="do-replace">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="by"/>
<xsl:choose>
<xsl:when test="contains($text,$replace)">
<xsl:value-of select="substring-before($text,$replace)"/>
<xsl:value-of select="$by"/>
<xsl:value-of select="substring-after($text,$replace)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:call-template name="do-replace">
<xsl:with-param name="text" select="."/>
<xsl:with-param name="replace" select="'8889/orabpel/default/Process1/1.0/Service/ServiceRequester'"/>
<xsl:with-param name="by" select="'8889/gateway/services/SID0003002?wsdl'"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
|