Hi

headers is the HTTP headers. And body is the HTTP body.

Though your body looks like its a html form, so maybe check what the
content-type is.

If the content-type is "application/x-www-form-urlencoded" then Camel
will map those key=value in the http body as Camel headers.

So if this was the intention from the remote http server, then change
it to return that value in content-type.

Otherwise you will have to parse the body yourself to grab those
details you need.

On Thu, Aug 7, 2014 at 3:20 PM, vishvjit <[email protected]> wrote:
> Hello,
> I have a route that calls a http service. The service sends reply in http
> body. Here is the snippet -
> /
> <setHeader headerName="Exchange.HTTP_QUERY">
>
> <simple>ID=${in.header.inputMsg.ID}&userID=${in.header.inputMsg.userID}&service=createUser</simple>
> </setHeader>
> /
> Comment - for some reason 've to set Body as well
> /
> <setBody>
>
> <simple>ID=${in.header.inputMsg.ID}&userID=${in.header.inputMsg.userID}&service=createUser</simple>
> </setBody>
> <to uri="http://somehost.com/controlServlet"/>
> /
> Comment - This returns Inputstream so convert to string
> /
> <convertBodyTo type="java.lang.String"/>
> /
> The reply body is something like
> /outputClassName=com.OutDTO&resultCode=1000001&resultMsg=DataAccess+update%28%29%3A++Cannot+update+record+id&id=0&serverStamp=1407391022041&/
>
> I 've set streamCache="true" for this route and also storing this reply in
> header (<setHeader headerName="replyMsg">) so that i can use it later in the
> route.
>
> I want to access the values for resultCode, id to build additional logic.
> How can I access these values from http reply body or replyMsg stored in
> header?
>
> Thanks for your help.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Accessing-variables-from-http-reply-body-tp5754899.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to