On Tue, Sep 9, 2014 at 11:52 AM, David <[email protected]> wrote:
> I have a configured cxf rsServer, which kicks off a camel route that then
> passes the request along to another service configured as a cxf rsClient
> endpoint. Both are POST operations. This mostly works well, except for the
> POST payload being sent to the second service.
>
> The first service contains two URL parameteres, so the definition looks
> something like this:
>
> @POST
> @Path("/foo/{param1}/bar/{param2}/op")
> @Consumes(MediaType.APPLICATION_JSON")
> public Response fooBar(@PathParam("param1")String param1,
> @PathParam("param2")String param2, Map<String, String> payload);
>
> The problem is that although when the initial request comes in the
> LoggingInterceptor prints my payload as:
>
> Address: http://localhost:8182/foo/valueOfParam1/bar/valueOfParam2/op
> ...
> Payload: { "one" : "number1", "two" : "number2" }
>
> it then sets the payload for the second to the value of param1:
>
> Address:
> http://localhost:8080/restpath/foo/valueOfParam1/bar/valueOfParam2/op
> ...
> Payload: valueOfParam1
>
> I would have assumed that it would forward the initial request's POST
> payload as the payload for the second service but, since it doesn't, how
> can I set the payload so that I get this result? I thought it would be easy
> to find this documented, but unfortunately haven't been able to (apologies
> if I'm missing something obvious).
>
> TIA
>
In case anyone else is trying to do this and comes across this message, it
is documented, just not with the kind of wording I was searching for. You
also need to use the simple binding style.
See the "Enabling the Simple Binding Style" section at
http://camel.apache.org/cxfrs.html