XSLT transformation on API Gateway

Hi guys,

I am using Software AG API GW v10.11 and want to achieve following:

Using XSLT request transformation I want to forward parameter from Headers section (in this case “ID”) to my native service. How can I achieve this?

I successfully mapped parameters from request itself but struggling with forwarding parameter from Headers tab.

Please, help!

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!-- Identity transform template -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
  
  <!-- Remove all request parameters except date -->
  <xsl:template match="request">
    <xsl:copy>
      <xsl:apply-templates select="date"/>
    </xsl:copy>
  </xsl:template>
  
  <!-- Add date parameter to request -->
  <xsl:template match="request/date">
    <xsl:copy>
      <xsl:value-of select="//request/date"/>
    </xsl:copy>
  </xsl:template>
  
  <!-- Add requestHeader with ID -->
  <xsl:template match="requestHeader">
    <xsl:copy>
         
      <ID>
        <xsl:value-of select="???????????????????????????????????????????"/> - here I need value from Headers parameter ID???
      </ID>
    </xsl:copy>
  </xsl:template>
  
</xsl:stylesheet>

Hi @ilicmarko ,
Have you explored the option in the request transformation where we can extract the data from incoming request and forward it to the native request.
It is available in the request transformation policy.

Regards
Vikash Sharma

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.