rucciva
rucciva

Reputation: 177

Obtain WSO2 API Manager synapse resource uri-template from MessageContext

Is there any way to get resource uri-template value from MessageContext to be used in custom Handler?

For example, if the api synapse config is

...
<api xmlns="http://ws.apache.org/ns/synapse"
         name="something"
         context="something"
         version="something"
         version-type="context">
       <resource methods="GET" uri-template="/?test={test2}" faultSequence="fault">
...

how can i get the '/?test={test2}' string into my custom handler.

Upvotes: 0

Views: 349

Answers (1)

Chamila Adhikarinayake
Chamila Adhikarinayake

Reputation: 3758

you could use following inside your handler

String resourceString = (String) synCtx.getProperty("API_ELECTED_RESOURCE");

where synCtx is the MessageContext

Upvotes: 1

Related Questions