How to call multiple web service using conditional route mediator and proxy service in wso2

StackOverflow https://stackoverflow.com/questions/22280882

  •  11-06-2023
  •  | 
  •  

سؤال

Hi I am new to wso2 . 

I want to call two different service (different URL) using a Proxy service based on some condition

I have two different service 1) One service to add and subtract two numbers 2) Another service to multiply and divide two numbers I want to create a proxy service to call this two service based on some condition,say if 1st number greater than second number,i need to call 1st service,otherwise i need to call second service

How to implement this using a proxy service

Can anyone help me how to use Conditional route mediator to implement this

Suggest me the best way to do this,Since i am new to WSO2,please help me in brief

Thanks in Advance

هل كانت مفيدة؟

المحلول

With WSO2 ESB, you can do this either via Filter Mediator or Conditional Router Mediator. There are many mediators and you can build your logic using desired mediators.

I would suggest you to go through documentation and samples.

There is one sample on Conditional Router Mediator, which will help you to understand on Conditional Router usage.

I think in your case, you should be able to use Filter mediator to compare your values via XPath operators.

For example, see the sample 156's filter mediator usage.

If you pass your values as URL parameters, you can get those URL parameters as properties.

Please note that these are just pointers for you to get started.

You can also try the WSO2 Developer Studio to create the ESB artifacts.

I hope this helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top