Thanks for the answer,

The REST service is always called with the HTTP "Accept" header set as one of 
the custom media types ("application/my.dummy.mediatype+xml" or 
"application/my.dummy.mediatype+json"). The REST DSL based route uses the value 
of that HTTP header to populate the "Accept" header of the Camel exchange in 
message. I use the value from the in message header (i.e. by using 
header("Accept")) to set the "Content-Type" header and when the route finishes 
that value should be used (by the REST DSL implementation) to set the HTTP 
"Content-Type" header of the HTTP response. (Setting "Content-Type" is usually 
the last thing I do in this kind of routes and code is also added to stop 
invalid HTTP "Accept" headers from beeing processed.)

I get the same behaviour (as mentioned in my first mail) if I (as an example) 
set the "Content-Type" header like this instead:
.setHeader(Exchange.CONTENT_TYPE, 
constant("application/my.dummy.mediatype+xml"))

Regards,
Calle

Reply via email to