users@jersey.java.net

Problem(buig ?) with jersey 1.0.3.1

From: vaidya nathan <vaidyaatdst_at_gmail.com>
Date: Mon, 19 Oct 2009 09:01:39 -0500

Hello,

I have the following schema definition. The Event top level has an
EventReq_type which has Errors element and within that an sequence of Error
elements and then then directly under the Event top level it has Errors
element which has a different element called serviceError.

Event -> EventReq_type->Errors->Error
and
Event->Errors->serviceError


<xs:complexType name="EventReq_type">
                <xs:sequence>
                        <xs:element name="Event" type="ns1:Event_type"/>
                        <xs:element name="Errors" type="tns:Error_type"
minOccurs="0"/>
                 </xs:sequence>
        </xs:complexType>


<xs:complexType name="Event_type">
                <xs:complexContent>
                        <xs:extension base="Event_Sum_type">
                                <xs:sequence>
                                        <xs:element name="Errors"
minOccurs="0">
                                                <xs:complexType>
                                                        <xs:sequence>
                                                                <xs:element
name="Error" type="DifferentErrorType" minOccurs="0" maxOccurs="unbounded"/>
                                                        </xs:sequence>
                                                </xs:complexType>
                                        </xs:element>
                                   </xs:sequence>
                        </xs:extension>
                </xs:complexContent>
        </xs:complexType>



After generating through xjc , i can use the jaxb to marshall/unmarshall the
elements but it is not able to pass through jersey(i used jersey 1.0.3 and
jersey 1.0.3.1 and both gave the problems). I think that the jersey
libraries are confused by the same name having different sub elements in
different structure even though they are under different trees. If i change
the name to be something else (for eg.instead of Event->Errors if i call it
as Event->ServiceErrors it goes through).The error that i get is that it is
syntactically incorrect(HTTP code of 400).

Thx