Transform native API response in webmethods API Gateway

Hi Community,

I am new to webMethods API Gateway. I am receiving some HTML response from native API in API Gateway and it includes some relative URLs in it as shown in below screenshot (yellow highlighted)

image

Now I want to change these relative URLs to something different like shown in below screenshot (green highlighted) before sending it out to API consumer:

image

I would appreciate if experts in community can guide me what is the easiest/shortest way of doing this response transformation in API gateway?

Thanks

Hi Ahmed,

please provide your API Gateway version.

Additionally, please describe your use case why you want to modify the links as shown above.

Regards,
Holger

@ahmed_shabbir You can write an XSL transformation which could transform the XML as per your requirement, then add the XSL file in the “Response Transformation” policy’s Payload Transformation section.

1 Like

Thank you for your response @Arundev_Chidambaram1.

Hello @ahmed_shabbir
In addition to XSL transformation approach (as advised by community member @Arundev_Chidambaram1 above) you may also be able to achieve it using standard string replace functionality, for example invoking a flow service in Response Processing policy and replacing desired part of URL in response with required string (or empty string etc)

However, I am not sure if this is something that we can achieve via Load Balancer in API gateway or not?

For example, applying or changing some specific setting/configuration in load balancer to replace specific url with desired url (or some part of url with desired part of url) while sending response back to consumer?

I don’t know much about load balancer and its features in API gateway. It’s just a high level assumption. May be other community experts including @Arundev_Chidambaram1 or @Holger_von_Thomsen would like to comment if it can be achieved via load balancer etc or not?

1 Like

@Mubarik APIGateway has a loadbalancer routing policy which just routes through the endpoints specified in round robin fashion. Its just a routing policy and it will not deal with any transformations.
As you said the use-case can be achieved using the following approaches,

  1. XSL transformation
  2. Invoking an IS service and handling the logic in there.
1 Like