Skip to main content

IBM

DataPower Playground for Gateway Script

datapower pg_featureimage

XSLT is not the ONLY transformation language supported by DataPower. Starting with the firmware version 7.0.0.0, DataPower supports a new transformation technology – Gateway Script, to handle all sorts (API, B2B, Web, Mobile, SOA) of traffic effectively. For more information, please review the documentation.

IBM provides an interactive website that lets you write Gateway Script code and execute on a cloud hosted DataPower Gateway for learning purposes. The website provides many examples that you can test as it is or edit based on your requirements. It also provides separate tabs to modify the sample code, provide request, view Response and logs.

I tested the following use-case in just a few seconds. There was no need to configure services, or policies to test the transformation piece through Gateway Script.

Use-case : Modify incoming JSON request payload (Add new object in Books array)

Step – 1 : Clicked on 1st sample in Code tab, tweaked the request as shown below.

IBM / Red Hat - Unlock Potential App Modernization
Unlock Your Potential with Application Modernization

Application modernization is a growing area of focus for enterprises. If you’re considering this path to cloud adoption, this guide explores considerations for the best approach – cloud native or legacy migration – and more.

Get the Guide

datapower pg_code

Step-2 : Provided the request in Request tab as shown below. Didn’t modify anything in HTTP headers field.

datapower pg_request

Step – 3 : View the response using Response tab.

datapower pg_response

 

Step – 4 : View the datapower system logs using Logs tab.

datapower pg_logs

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow Us
TwitterLinkedinFacebookYoutubeInstagram