Business object XML using the JMS TextMessage interface serializes the business object to and from XML and uses a JMS text message to communicate with the JMS client. The serialization for an anonymous schema type or a named schema type is described in this section.
If the business object is defined by a schema using an anonymous type such as the following code:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ModuleTest"> <xsd:element name="Employee"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="name" type="xsd:string" /> <xsd:element minOccurs="0" name="empno" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
Then the contents of the JMS text message would be the following code:
<?xml version="1.0" encoding="UTF-8"?> <module:Employee xmlns:module="http://ModuleTest"> <name>Name1</name> <empno>007</empno> </module:Employee>
If the business object is defined by a schema using a named type such as the following code:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ModuleTest" targetNamespace="http://ModuleTest"> <xsd:element name="Employee" type="tns:EmployeeType"></xsd:element> <xsd:complexType name="EmployeeType"> <xsd:sequence> <xsd:element minOccurs="0" name="name" type="xsd:string" /> <xsd:element minOccurs="0" name="empno" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:schema>
Then the contents of the JMS text message would be the following code:
<?xml version="1.0" encoding="UTF-8"?> <module:Employee xmlns:module="http://ModuleTest"> <name>Name1</name> <empno>007</empno> </module:Employee>