Some mediation primitives use an XML serialization of a Service Message Object (SMO).
The Message Logger and XSLT mediation primitives use an XML serialization of the SMO.
The Message Logger mediation primitive logs an XML serialization of the SMO. The XSLT mediation primitive transforms messages using an XSLT 1.0 transformation. The transformation operates on an XML serialization of the SMO. If you need to understand the data logged by the Message Logger, or write XSL transformations that operate on an XML serialization, then you should know how the SMO is represented as XML.
Typically, an SMO has header data, context information, and a body containing the message payload. The message payload is the application data exchanged between service endpoints. The header data is of a fixed structure; the structure of the context data is partially fixed and partially defined by the flow designer. The structure of the body is defined by reference to a WSDL-defined message.
The Message Logger and XSLT mediation primitives allow the root of the serialization to be specified, and the root element of the XML document reflects this root.
Typically, the root element is named after the selected root in the SMO structure and is in the default namespace. However, if the entire SMO is serialized, by chosing / as the root in the mediation primitive, then the root element is named smo and is in the SMO namespace.
<?xml version="1.0" encoding="UTF-8"?> <smo:smo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:accounts="urn://www.example.com/accounts" xmlns:smo="http://www.ibm.com/websphere/sibx/smo/v6.0.1"> <context> <correlation xsi:type="accounts:CorrelateByAgentId"> <agentid>SMI537654-2</agentid> </correlation> <transient xsi:type="accounts:ExchangeRate"> <from>GBP</from> <to>USD</to> <multiplier>1.74068</multiplier> </transient> </context> <headers> <SMOHeader> <MessageUUID>b048778f-0701-0000-0080-80c5b8a4d8b8</MessageUUID> <Version> <Version>6</Version> <Release>0</Release> <Modification>1</Modification> </Version> </SMOHeader> </headers> <body xsi:type="accounts:processPaymentRequestMsg"> <processPayment> <agentid>SMI537654-2</agentid> <priority>2</priority> <payment> <value>415.26</value> <currency>USD</currency> <date>2005-01-16Z</date> <account>546219G</account> </payment> </processPayment> </body> </smo:smo>
<?xml version="1.0" encoding="UTF-8"?> <body xsi:type="accounts:processPaymentRequestMsg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:accounts="urn://www.example.com/accounts"> <processPayment> <agentid>SMI537654-2</agentid> <priority>2</priority> <payment> <value>415.26</value> <currency>USD</currency> <date>2005-01-16Z</date> <account>546219G</account> </payment> </processPayment> </body>
The root element of the XML serialization contains type information to identify the structure.
Type information is represented either as a global element definition or as an xsi:type attribute. An example of a global element definition is the smo:smo element used when serializing from /. An example of an xsi:type attribute is shown in the serialization from /body.
Type information is also recorded in the body element and in the transient and correlation context elements, even if they are not at the root of the serialization.
The body element and the transient and correlation context elements are of a structure chosen by the mediation flow designer. When serialized as XML, an xsi:type attribute is used to describe the structure. Typically, the body has an xsi:type attribute naming a WSDL-defined message. The WSDL-defined message can be constructed using the interface editor in WebSphere Integration Developer. Usually, the transient and correlation context elements have an xsi:type attribute naming an XSD-defined type. The XSD-defined type can be constructed using the business object editor in WebSphere Integration Developer.
The body of the XML serialization is usually created by reference to a WSDL message.