Hi
I have my request coming into the Synapse.XML as a string.Now i want to
retieve the value of a particular node and on the basis of this value I want
to forward my request to two different URL"S.
Can i write a java class which takes my string as input and returns the
required value as output.
Yes. One option is to write a POJO which would contain a setter method
to accept the String parameter, and a getter to return the value
required. The execute() method, could then use the String and perform
whats required to generate the output. See [1]
You could also use a Class mediator - but this requires your code to be
compiled against the synapse core JAR, and would then receive a Synapse
MessageContext [2], from which you need to extract the String you
require, and possibly set a property with the result, so that you could
subsequently call the get-property() function to retrieve it for your
switch statement
If so how to merge the given value with the switch statement.
OR i should use x path queries ?
I think a pojo/class mediator is the most suitable for this scenario..
cheers
asankha
[1]
http://synapse.apache.org/Synapse_Configuration_Language.html#pojoCommand
[2] http://synapse.apache.org/Synapse_Extending.html
--
Asankha C. Perera
http://adroitlogic.org
http://esbmagic.blogspot.com