0
votes

I am new to wso2

I have created two jar services

1) Simple service has two methods add and subtract two numbers

2) simple service has two methods multiply and divide two numbers

I want to invoke these two services based on some condition,that i have implemented using Filter Mediator.

I want to call the methods inside those services.

Say, If a > b I called first service,then I want to call the operations(methods) inside these service,say addTwoNumbers(int a,int b) and subTwoNumberes(int a , int b)

How to call these methods using proxy service?

Can anyone help me on this ?

1
Thanks Prime.. Can you help me for the solution ...Mahesh Narayanan
If I understand, your services aren't deploy as Webservices, you just want to call those classes methods from java ?Jean-Michel
No Jean.. I have deployed those services as JAR services.. I have two operations in those services.. So how i need to call those methods using a proxy service,,Mahesh Narayanan

1 Answers

0
votes

You have two backend services and you want expose both service as one proxy service.. then this proxy service must capable of deciding the backend service that message must be sent. So, you can create one proxy service using WSO2ESB and you can attach a new WSDL for it. Once message is received to proxy service, filer mediator can use to send it to different BE based on the parameters. You can extract the a and b values from the incoming message by using XPath expression. Then these two values can be compared. Once filter mediator compares them, you can build the SOAP message that is required to send to your services.

You can use following WSO2ESB docs for this..

1.How to create proxy service 2.XPath 3.Filter mediator 4.PayloadFactory Mediator

Also please refer ESB docs, you may fine more details