users@jaxb.java.net

marshalling and unmarhalling a sequence of any element

From: Davide Gesino <williamkidd_at_libero.it>
Date: Fri, 28 Sep 2007 02:48:19 -0700 (PDT)

Hi,

I am encountering a problem mashalling and unmasrhalling data containing a
List of any objects, such as:

<xs:complexType name="MEVendorExtensions_T">
        <xs:sequence>
                <xs:any namespace="##any" processContents="lax"
                        minOccurs="3" maxOccurs="unbounded" />
        </xs:sequence>
</xs:complexType>.

JAXB converts an annotation like this in an ArrayList of object.
I have a question.
How can I marshall and unmarshall some data in this list of objects? I have
tried marshalling a complex type encapsulating it in a JAXBElement in ths
way:

  JAXBElement<String> jxNameAndStrVal =
      new JAXBElement<String>(new QName("tmf854.v1"),
                                                               String.class,
                                                               
elementToPass);

the marshalling seems to work fine ( the SOAP message seems formatted
correct).

Anyway when the client receives the data he get the elements encapsulated in
a xerces NMElement, and he cannot recover the class of the object he gets.
(I noticed the "type" in the nmelement is null).

How can I get back thee class of the object and the recover the instance?
Is the marshalling correct?
How coud I marshall a complex type!=String?

Thanks

Davide


-- 
View this message in context: http://www.nabble.com/marshalling-and-unmarhalling-a-sequence-of-any-element-tf4533411.html#a12937524
Sent from the java.net - jaxb users mailing list archive at Nabble.com.