Skip to Main Content

Integration

can ESB JMS adaptor work with the XML message without namespace ?

538531Sep 22 2008
I am working on ESB Project. Project has to read XML message form the JMS queue using ESB JMSAdapter. JMSAdapter will convert the XML string to object using the schema file.

Here is the xml request message, which is to be read form the JMS queue.

<?xml version="1.0" ?>
<AAA>
<Header>
<Code>CCC</Code>
<Partner>PPP</Partner>
</Header>
<Body>
<Request>
<Context>CX01</Context>
<Case>C001</Case>
<Number>84444444</Number>
</Request>
</Body>
</AAA>

Here is the schema file for the XML file given below.

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://www.example.org"
elementFormDefault="unqualified">
<xsd:element name="AAA">
<xsd:annotation>
<xsd:documentation>
A sample element
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Header">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Code" type="xsd:string" default="XXX"/>
<xsd:element name="Partner" type="xsd:string" default="YYY" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Body">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Context" type="xsd:string"/>
<xsd:element name="Case" type="xsd:string"/>
<xsd:element name="Number" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

The problem is that ESB is not able to read the values from the XML file, if I provide the given XML file show above which has no namespace.

If I provide the following XML file with the namespace as shown below, ESB is able to read the values form the file.


<?xml version="1.0" ? >
<req:AAA xmlns:req="http://www.example.org">
<Header>
<Code>CCC</Code>
<Partner>PPP</Partner>
</Header>
<Body>
<Request>
<Context>CX01</Context>
<Case>C001</Case>
<Number>84444444</Number>
</Request>
</Body>
</req:AAA>

I want to read the XML without namespace. Does anybody have any idea how can I do this? How can I get my ESB to read the XML message form the JMS queue which has no namespace?
Post Details
Locked on Oct 20 2008
Added on Sep 22 2008
0 comments
223 views