0

In DataPower, I have to read the incoming requests soap action. Once read, I need to extract the last string after delimiter and save it in the variable. Then I need to modify the SoapAction and set as new value for every request going outside Datapower.

I have

    SOAPAction="http://service.example.com/version10_1/getMessage"

I want it as

    SOAPAction="http://service.example.com/version11_1/getMessage"

I have an idea to use functions like below. Please suggest on 1. how can I substring the value"getMessage" from the Header. I want to use it further by saving in a variable.. 2. And what is the better way to modify the incoming SOAPAction and send it new. Only Version is modified from version 10_1 to 11_1.

 <xsl:template name="HeaderChange">

  <xsl:variable name="IncomingRequest" select="dp:request-header('SOAPAction')"/>

    <xsl:variable name="Mymethod"><xsl:value-of select=(get  the        getMessage    here)/></xsl:variable>

     <dp:set-http-request-header name="SOAPHeader" value="'to modify old SOAPAction'"/> 

      <dp:freeze-headers/>
      </xsl:template>
Mano
  • 143
  • 1
  • 2
  • 13

3 Answers3

1

Seems like a job for the standard substring-before and substring-after XPath functions.

<xsl:value-of select="concat(
    substring-before($IncomingRequest, 'version10_1'),
    'version11_1',
    substring-after($IncomingRequest, 'version10_1'))"/>
bjimba
  • 928
  • 8
  • 13
0

I think you can do this by using url rewrite policy in header rewrite action also.

0

you could simply add using the Headers/Param tab, wherein you can add the Header Name and Value.

DroidDP
  • 26
  • 2