Hi
On 10/09/13 01:48, Dev1 wrote:
Hi all,

In my CXF REST service, I have the outgoing response of type
org.apache.cxf.message.XMLMessage and I need to set the content type of the
message.
I used this - message.setContextualProperty( message.CONTENT_TYPE,
"application/json" );
But it does not work since the contextcache is empty.

How to modify the existing content type in org.apache.cxf.message.XMLMessage
object?

message.put(Message.CONTENT_TYPE, "application/json");

will do it, though note that updating Content-Type in outgoing messages did not really work well till CXF 2.7.6 where you can also use ContainerResponseFilter

Cheers, Sergey



Thanks in advance.




--
View this message in context: 
http://cxf.547215.n5.nabble.com/XMLMessage-content-type-tp5733764.html
Sent from the cxf-user mailing list archive at Nabble.com.


Reply via email to