Namespaces with non-XML messages

The use of namespaces by IBM® Integration Bus is not necessarily limited to XML message models.

There is one scenario where the use of namespaces by non-XML message models can simplify the ESQL or Java™ code that you write. Before describing this scenario, it is important to understand that the DFDL and MRM parsers, when parsing messages that are defined in a file that has a target namespace, produce a logical message tree that contains both name and namespace information. For non-XML messages, the namespace is obtained from the element declaration in the file, and not from the data.

Consider a transformation scenario where a message from a COBOL application requires to be transformed into namespace-aware XML; for example, a SOAP XML message. The transform must map the logical message tree that was created for the COBOL message to a logical message tree that matches the XML message. If the COBOL message tree does not contain namespace information, each mapping from a COBOL field to an XML element must set the namespace for the XML element. However, if the COBOL message tree already contains the required namespace information, this mapping is much simpler.

To enable the DFDL or MRM parser to create namespace information in a message tree that was created from a non-XML message, you must specify a target namespace for the DFDL schema or message definition file. For MRM, this must be done as part of the file creation process; for DFDL this must be done after the file has been created in the DFDL editor. Make the target namespace of the file the same as the target namespace of the XML message into which the non-XML message is being transformed.

When dealing with both the message tree for the non-XML message and the message tree for the XML message, the ESQL or Java code that you write to perform the transformation must be namespace aware.