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?

http://help.boomi.com/atomsphere/GUID-BB0B00D8-5FD7-4668-9DC7-37B26E34977E.html

                    Result Content Type                     

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

                    
  •                               

                                       text/plain

                             
  •                               

                                       text/HTML

                             
  •                               

                                       text/XML

                             
  •                               

                                       application/binary

                             
  •                               

                                       application/EDIFACT

                             
  •                               

                                       application/EDI-X12

                             
  •                               

                                       application/XML

                             
  •                               

                                       application/JSON

                             
               

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: 

http://help.boomi.com/atomsphere/GUID-9DBB4927-E4FA-40F7-9A3C-077063E1AE7F.html 

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

Attachments

    Outcomes