Integration Server 11.1 | Integration Server Administrator's Guide | Controlling Formatting when Decoding XML
 
Controlling Formatting when Decoding XML
When Integration Server decodes an XML document, the XMLCoder inserts spaces for indenting for each level of XML tag and newlines. When decoding a large XML document with a deeply nested tag structure, the XMLCoder may be attempting to insert thousands of spaces and newlines to show hierarchy. While this "pretty" processing makes the XML more human readable when viewed in a text editor, it may cause Integration Server to become unresponsive.
To mitigate this issue, Integration Server includes the ability to disable pretty processing by the XMLCoder. When the XMLCoder perform pretty processing, it inserts spaces and new lines, making the XML more readable when viewed in a text editor. If pretty processing is not performed, the XMLCoder does not insert spaces or newlines. When viewed in a text editor, the resulting XML appears as a long string and is not very human readable.
Integration Server includes a special HTTP header to disable the pretty function when the XMLCoder decodes an XML document received in a request. When an incoming request includes the header $$$webm-xmlcoder-pretty:false, the XMLCoder does not perform pretty processing for nested tags. That is, the XMLCoder does not insert spaces for XML tag level indentation or newlines. This may prevent Integration Server from becoming unresponsive when XMLCoder processes a large XML document with deeply nested tags. If the incoming request does not include the header $$$webm-xmlcoder-pretty or includes $$$webm-xmlcoder-pretty:true, the XMLCoder performs the pretty processing.
The Integration Server Java API includes the following methods that can be used to detect and set pretty processing for the XMLCoder:
*com.wm.util.coder.XMLCoder.setPretty - Sets a Boolean flag that specifies whether XMLCoder inserts a space for each nested tag level when decoding an XML document.
*com.wm.util.coder.XMLCoder.isPretty - Returns a Boolean indicating if the XMLCoder performs pretty processing by inserting a space for each nested tag level when processing an XML document
For more information about these methods, see the IBM webMethods Integration Server Java API Reference.