• 1 reply
  • Latest Post - ‏2013-08-16T14:52:07Z by swlinn
27 Posts

Pinned topic Doubt in Routing request

‏2013-08-16T06:50:03Z |

HI forum,

How can i route a request from datapower in two different ways to the same end point(web services).

If my request is of 1st type, then my request should be straight request-response with webservices.

if my request is of 2nd type, then i want webservices only as a sidecall which i can call using skip backend. The response from that sidecall will be routed to some other point and response returned from that point will be the final response needed.

Is it better to differentiate at request level? if so, how can i do this.

or because any of the request will go to webservices, is it better to route after collecting response from webservices. how to achieve that.

Please suggest.





  • swlinn
    1407 Posts

    Re: Doubt in Routing request


    You can accomplish conditional processing as you desire using the conditional action.  The input to the conditional action must be XML, ie, you can't be using DataPower variables, so you could have a stylesheet that would output <type>type1</type> for example, the conditional action would use the xpath of /type = 'type1' to do a set-variable action that would set the routing-url service variable to the normal endpoint, and another xpath  not(/type = 'type1') would call a transformation that would do your side call and you'd set the routing-url service variable to some other point.  You could also then have a conditional at the end of your rule with the same Xpaths, one that sent the INPUT context if type1, the other the context name of your sidecall xsl output.  You could of course also copy the INPUT context to a context named the same as the output of your sidecall xsl, the the conditional on the result would save some memory.