How to set the content type for a web service server operation (it is default to application/xml)

Document created by mike_aronson Employee on May 13, 2014
Version 1Show Document
  • View in full screen mode
In a web service server operation, the Result Content Type is defaulted to application/xml or application/json when you select Output Type = XML or JSON options.

But what if you want to set the Content-Type to something else, for example for Single Data or if you want to override the defaults above?

For example, the reference guide lists a variety of content types below, but how can they be set?

                    Result Content Type                     

                         (Available if Output Type is anything other than None.) A two-part identifier for file formats on the Internet.


















The content-type can be defined as a user-defined document property using the outheader_ prefix (e.g. set "outheader_Content-Type"). If nothing is defined, then it will use application/xml. This is also described at this link: 

For example, prior to the Return Documents shape, you might use a Set Properties shape, to set the property "outheader_Content-Type" to be the static string "text/XML".

This may also be set when invoking the web service on the client application / client request side.
1 person found this helpful