Forum Stats

  • 3,770,401 Users
  • 2,253,103 Discussions
  • 7,875,442 Comments

Discussions

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

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?
Tagged:
This discussion has been closed.