SMO body

The body of a service message object (SMO) is defined by reference to a Web Services Description Language (WSDL) message.

Introduction

Typically, the structure of an SMO body is defined by reference to a WSDL message.

For each part defined by the WSDL message there is one element under the SMO body. The contents of the SMO elements are of the structure of the WSDL part definition. The element names depend upon the kind of WSDL message that the SMO is defined from.

Document literal wrapped and similar WSDL message styles

The document literal wrapped style of WSDL produces SMO bodies that contains a single element. This WSDL style is commonly used by web service designers, and is generated by the interface editor ofIBM® Integration Designer.

If the WSDL message has a single part, typed in the WSDL definition by a global element, then the SMO body contains a single element. The single element is named after the WSDL global element.
Note: The single element is not qualified by a namespace. The namespace of the global element is ignored.
For example, consider the following WSDL.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="urn://www.example.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DLWInterface" 
  targetNamespace="urn://www.example.org">
  <wsdl:types>
    <xsd:schema targetNamespace="urn://www.example.org" xmlns:tns="urn://www.example.org" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:element name="operation1">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="name" nillable="true" type="xsd:string"/>
            <xsd:element name="age" nillable="true" type="xsd:int"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="operation1Response">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="surname" nillable="true" type="xsd:string"/>
            <xsd:element name="height" nillable="true" type="xsd:float"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
    <wsdl:message name="operation1RequestMsg">
    <wsdl:part element="tns:operation1" name="operation1Parameters"/>
  </wsdl:message>
    <wsdl:message name="operation1ResponseMsg">
    <wsdl:part element="tns:operation1Response" name="operation1Result"/>
  </wsdl:message>
    <wsdl:portType name="DLWInterface">
    <wsdl:operation name="operation1">
      <wsdl:input message="tns:operation1RequestMsg" name="operation1Request"/>
      <wsdl:output message="tns:operation1ResponseMsg" name="operation1Response"/>
    </wsdl:operation>
  </wsdl:portType>
</wsdl:definitions>
This example WSDL could produce an SMO body similar to the following.
<body xsi:type="tns:operation1RequestMsg">
  <operation1>
    <name>Bob</name>
    <age>35</age>
  </operation1>
</body>

This example could have an XPath such as: /body/operation1/name

Other styles of WSDL

If the WSDL message has many parts then the name of each element in the SMO body, is the same as the corresponding WSDL part. If the WSDL message has a single part described by an XSD type, then the name of each element in the SMO body is also the same as the corresponding WSDL part.

For example, consider the following WSDL.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="urn://www.example.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="NonDLWInterface" 
  targetNamespace="urn://www.example.org">

  <wsdl:message name="operation2RequestMsg">
    <wsdl:part name="name" type="xsd:string"/>
    <wsdl:part name="age" type="xsd:int"/>
  </wsdl:message>
  <wsdl:message name="operation2ResponseMsg">
    <wsdl:part name="surname" type="xsd:string"/>
    <wsdl:part name="height" type="xsd:float"/>
  </wsdl:message>
  <wsdl:portType name="NonDLWInterface">
    <wsdl:operation name="operation2">
      <wsdl:input message="tns:operation2RequestMsg" name="operation2Request"/>
      <wsdl:output message="tns:operation2ResponseMsg" name="operation2Response"/>
    </wsdl:operation>
  </wsdl:portType>
</wsdl:definitions>
This example WSDL could produce an SMO body similar to the following.
<body xsi:type="tns:operation2RequestMsg">
    <name>Bob</name>
    <age>35</age>
</body>

This example could have an XPath such as: /body/name

Interface editor of IBM Integration Designer

If you create an interface using the interface editor of IBM Integration Designer, then the resulting WSDL will be of the document literal wrapped style. However, you can view and edit WSDL files that are not of the document literal wrapped style, using the interface editor. In some cases, the interface editor might not display information needed to determine the structure of the SMO body.