How to set Content-Type of SOE REST Web Service in Java

Discussion created by t.deelmann-conterra-de-esridist on Jan 12, 2012
Latest reply on Oct 18, 2012 by TomLUX

since I didn't find anything helpful, I will post my question here.

I developed a SOE REST Web Service with the Java AcrObjects SDK. For a specific operation I want to return a XML document and for another operation an image.

In another Thread (http://forums.arcgis.com/threads/7993-SOE-REST-Web-Service-How-to-return-different-MIME-content-types) I read that this is possible by setting the responseProperties parameter of the handleRestRequest method of the IRESTRequestHandler interface. So I tried to set it the following way before returning the byte array:

responseProperties = new String[]{"{\"Content-Type\" : \"text/xml\"}"};

Unfortunately this has no effect on the response content type, which is still text/plain.

Is there anything wrong with this approach or did I miss something?

Any help or working examples would be very much appreciated.