Greetings-

I'm trying to convert code that uses Castor 1.2 to using JiBX 1.2.2.
I have to say, the difference in performance is awesome!  However, I'm
running into an issue where an XML message being sent into the new
JiBX code is not able to be unmarshalled (but worked on the old code).

The schema (greatly simplified for the example) looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    attributeFormDefault="unqualified"
    elementFormDefault="qualified"
    targetNamespace="http://xml/schema";
    version="2.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema";>

    <xs:element name="person">
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
</xs:schema>

The old client is sending in this message to my service:
<?xml version="1.0" encoding="UTF-8"?>
<person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="http://xml/schema"; name="name"/>

With the above message, JiBX is throwing this:
org.jibx.runtime.JiBXException: No unmarshaller for element "person"

It appears that the issue is caused by the lack of the default
namespace (xmlns="http://xml/schema";) in the input... perhaps the
client is incorrectly setting the "noNamespaceSchemaLocation"
attribute instead.  If I inject the default namespace into the
message, JiBX unmarshals the message no problems.

I don't have control over the client message, so I need to find some
way to massage JiBX into processing this message.  I have experimented
with numerous options on the CodeGen command line and with several
schema/schema-set customizations with no success.  So my question...
how do I get JiBX to unmarshal this sort of message?  Is there a way
to set the default namespace before attempting to unmarshal this
message?

Thank you
-Michael

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to