Yes, you described just the idea I was about the propose ;) Take into
account that Exchange properties are treated like local variables inside
the route's execution, kind of like BPEL variables if you're familiar with
them. So the way you propose is totally legal.

However, here's an alternative idea. After you get the response from the
endpoint, you can perform a <wireTap /> to a seda: endpoint. This will
create a copy of the Exchange and will branch off and run independently
from the main route. Create a route that consumes from this seda: endpoint,
overrides the body with the value of the XPath (use the <transform /> DSL)
and sends it to the required endpoint.

If, on the other hand, you want the callout to execute synchronously (so
that the main route waits), you can use <enrich /> together with
the UseOriginalAggregationStrategy [1] aggregation strategy. That will
preserve the original Exchange after the callout finishes.

To be fair, doing a synchronous callout with a different payload while
preserving the original Exchange is a typical use case. Maybe we should
support a <callOut /> DSL, which acts like I described above with the
enrich DSL?

[1]
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/aggregate/UseOriginalAggregationStrategy.html
.

Hope that helps,

-- 
*Raúl Kripalani*
Apache Camel Committer
Enterprise Architect, Program Manager, Open Source Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk <http://twitter.com/raulvk>

On Tue, Oct 2, 2012 at 11:04 PM, suralk <[email protected]> wrote:

> Hi Raul,
> I want to extract only a particular element from the soap message and send
> it to another endpoint. This element value will be stored in the body of
> the
> message to the destination endpoint. So I do not want to set it as a
> header.
> i assume that I can assign the element value to a temporary header, and
> later get it to the body. But this does not look like the correct way to do
> it. Ideally, I would like to set the body of the message straightaway from
> the soap element
>
> /sura
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-to-access-a-SOAP-message-part-inside-a-route-tp5720345p5720404.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to