An XMLMessage is a message type whose body contains a well-formed XML document (a SAX-WRITER, SAX-READER, or X-DOCUMENT). ABL has built in support to send and receive XML messages. The following table lists the methods for handling XML messages.

Table 1. Methods for handling XML messages
Create method Populate method Access method
createXMLMessage procedure setText procedure, setLongText procedure, appendText procedure, reset procedure, setX-Document procedure, setSaxReader procedure, deleteSaxWriter procedure, clearBody procedure endOfStream function, getCharCount function, getText function, getTextSegment function, getLongText function, getLongTextCP function, getSaxWriter function, getX-Document function

The XMLMessage is an extension of a JMS TextMessage. XMLMessage supports the same methods as TextMessage.

XML messages can be used in conjunction with the ABL XML parser:

  • Incoming messages — Parse the XML text using the getX-Document function or the setSaxReader procedure
  • Outgoing messages — Save the XML text using the setX-Document procedure or the getSaxWriter function

It is important to consider the code page of XML messages. (A code page is a table that maps each character on it to a unique numeric value.) Theoretically, any code page can be used to encode XML documents. However, each XML parser supports some or all code pages, and XML parsers differ with respect to the code page conversions that they can do.

With the ABL–JMS API, the conversion rules are straightforward. The text stored in an XML message by the OpenEdge application is expected to be encoded in the internal code page of the OpenEdge client (the –cpinternal startup parameter). For more information on the -cpinternal startup parameter, see Startup Command and Parameter Reference.

The ABL–JMS implementation automatically converts the text to Unicode when a SonicMQ XML message is created. Unicode is an encoding format that provides a unique number for every character, regardless of platform, program, or language. The ABL–JMS implementation also converts the Unicode text received in XML messages to the internal code page of the OpenEdge client when the text is extracted.