I have a class mediator in sequence which will have list of requests.
Now I need to iterate the list of request and send it to a defined end point.
Please advise.
You can use Call Mediator to call multiple web services in a single sequence.
See Call Mediator for details.
You can do iterate your messages using Iterate mediator.
See Iterate Mediator for details.
Thanks
Related
Can anyone please explain me the difference between the class mediator and custom handler in detail, what use cases these two mediators are used
Existing handlers are executed first in the request flow. Mediation sequences are executed after that. But if you write a custom handler, you can put it after mediation sequences as well, because mediation sequences are also executed by a handler (APIManagerExtensionHandler). So if you place your handler after APIManagerExtensionHandler, it will execute after mediation sequences.
One main difference between a class mediator and a handler is that handlers are executed in both request flow and response flow, and you can write 2 logics for those 2 cases in the same handler. But a class mediator has only a single section (i.e. mediate() method). When you engage a class mediator in a sequence, you can decide if you want to put it in request flow or response flow, or in both.
If your logic is not complex, you can use existing mediators instead of writing a class mediator. In that case, you don't need to write any java code.
You may read this as well.
Anybody would please through some light on difference between call and send mediator and what use cases these two mediators are used.
Send mediator - used to send messages out of Synapse to some endpoint. Then the response is returned to the OutSequence where you can send it back to the client
Use cases - When you only need to send a message to one back end and return the response back to the client.
Call mediator - Also used to send messages out of the Synapse to some endpoint, but the response does not come to the OutSequence. When we send a request using the call mediator, the response will arrive to the mediator that is placed right after the call mediator.So this will allow us to specify all the service invocations one after the other in a chain within a single sequence
Use cases - Service chaining. i.e.- Vehicle license renewal service
Another characteristic is that the callout mediator is blocking, send mediator and call mediator are not blocking. This answer is in regards to WSO2 versions until 4.8.0
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.
Will the aggregator mediator work in insequence ?
I have a splitter which will split the messages to JMS queue. I have another proxy service which should collect the messages and aggregate it.
I have kept the aggregator in insequence. Am I logically correct ?
Regards
Guru
#gnanagurus
Message aggregation cannot be done in the inSequence without having a iterate mediator placed in inSequence.
There is a correlation between the splitting and the aggregation.
You can only aggregate messages which are split using the iterate mediator or cloned using clone mediator within the same Proxy service.
If you can provide me more information on your scenario, I can help you further.
I have seen some of the SOAP- Example- Mediators. I have not found a transformation based on the endpoint-WSDL.
I want to send some nested named array in json or POX and that data should go into a complete namespaced headered (username, password) SOAP-Request based on the names.
All the examples I have found had either a very simple wsdl or the namespaces were static in the XSL-Transformation.
It should be possible to do that, as I see in for example php-NuSOAP. You feed it with a wsdl-endpoint, the operation you want to execute and the parameter-array, and it calls the Webservice.
I am looking for a solution which is not too much hardcoded for every single service, so the proxy still works when the wsdl changes and Server Clients get changed.
As far as I understand the payload factory mediator in (https://stackoverflow.com/a/12969814/2277620) you would have to hardcode the soap-format in the mediator.
If WSO2 is the wrong tool for that I'd like to have a hint which tool could help.
Thanks in advance!
Marco.
For my understanding, you want to have a proxy, but it's backend service/wsdl may vary..
What , you can do is, you can save the wsdl (dynamic wsdl)in registry and point that in your proxy. whenever you edit the wsdl, proxy will automatically adopt to that..But the request, which you send to your backend should follow the wsdl definitions..It is totally client side responsibility..