You can do want you want in the PrepearParmeterForWebServiceB(),
basically the inMessage's body that is passed to this processor is
changed to be the response of webservice A. If you want to get the
original input , you'd better store the original input into the message
header before sending the request to webservice A .
Willem.
docs123 wrote:
Thanks.
Just want to be sure - The second processor (
PrepearParameterForWebServiceB() ) will "know" to process the original input
and will not refer to the output recieved from webservice A as the input it
needs to process?
willem.jiang wrote:
Hi ,
I think you could use choice [1] to implement the flow, since there are
some requirements of the webservice request[2], you may need a processor
to take care of the parameters.
Here is an example of DSL
from("YourStartPoint")
.process(new
PrepearParameterForWebServiceA()).to("cxf://WebServiceA")
.choice(when(body().isEqualTo(Boolean.TRUE))).process(new
PrepearParameterForWebServiceB()).to("cxf://WebServiceB")
.otherwise().process(new SetFaultBackProcessor());
[1]http://activemq.apache.org/camel/routes.html#Routes-Choices
[2]http://activemq.apache.org/camel/cxf.html#CXF-HowtopreparethemessageforthecamelcxfendpointinPOJOdataformat
Willem
docs123 wrote:
Hi,
I'm new to camel and I need help to see if I use camel for implementing
the
following flow:
User calls camel with input containing A and B elements.
Camel will take element A and call webservice A (sending it element A as
an
input):
1. In case webservice A returns true - camel will call webservice B with
element B (from the original input message) as an input, and the output
back
to the user will be the output from webservice B.
2. In case A returns false - the user will recieve some error message.
Can I implement this flow with camel built-in processors or do I need to
write my own processors?
Thanks