XML representation of SMO

Some mediation primitives use an XML serialization of a Service Message Object (SMO).

Introduction

The Message Logger and Mapping mediation primitives use an XML serialization of the SMO.

The Message Logger mediation primitive logs an XML serialization of the SMO. The Mapping mediation primitive transforms messages using an XSLT 1.0 or XSLT 2.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 must 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.

Root element

The Message Logger and Mapping 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.

For example, an SMO serialized from / might look as follows:
<?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>
The same SMO, serialized from /body, would look as follows:
<?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>

Body structure

Typically, the body of the XML serialization is defined by reference to a WSDL message.

For each part defined by the WSDL message there is one element underneath the body. Each element is named as follows:
  • If the WSDL message has a single part, typed in the WSDL definition by a global element, then the body contains a single element named after the global element. This case includes the document literal wrapped style of WSDL definition. This style is commonly used by web service designers, and is generated by the interface editor of IBM® Integration Designer.
    Note: The element is in the default namespace, and not in the namespace of the global element.
  • If the WSDL message has many parts, or if it has a single part described by an XSD type, then the name of each element is the same as the corresponding WSDL part.