Hi Michael,

A similar issue came up recently, with this solution:
http://www.mail-archive.com/jibx-users%40lists.sourceforge.net/msg04568.html
Hopefully you can apply the same approach in your application.

  - Dennis

Dennis M. Sosnoski
Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
Axis2/CXF/Metro SOA and Web Services Training
<http://www.sosnoski.com/training.html>
Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>


On 02/04/2011 12:02 PM, Michael McMaster wrote:
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to