users@jaxb.java.net

Marshaller bug

From: Martin Bosak <bosakm_java_at_FMCTC.COM>
Date: Thu, 13 Feb 2003 21:06:55 -0700

I hope this has already been fixed in the well-guarded 1.0 Sun internal build :)

I ran into a problem when Marshalling an instance of a class generated from the following schema fragment. (The fragment is from the IFX 1.3.0 schema available from www.ifxforum.org). I created an instance of SignonRs from the ObjectFactory and populated it with a Status element. I also populated with the required elements of the optional second sequence (e.g., the ClientDt, CustLangPref, ClientApp, ServerDt and Language elements). When I marshalled this instance to an XMLWriter instance (a freeware class that Kohsuke referred me to. I modified it to allow the <?xml line be optional.) and retrieve the String representation from it, ALL the elements from the optional second sequence were missing. They were in the JAXB Generated class because I could see them in my IDE's debugger (WSAD 5.0 GA).

If I can supply additional data, E-mail me directly at my work address (bosakm_at_aciworldwide.com). The address I signed up with for this group is one I have at home reserved for Java related things).

Schema fragment:

<xsd:element name="SignonRs" type="SignonRs_Type"/>
<xsd:complexType name="SignonRs_Type">
    <xsd:sequence>
 <xsd:sequence>
    <xsd:element ref="Status" minOccurs="0"/>
    <xsd:element ref="SignonRole" minOccurs="0"/>
    <xsd:element ref="CustId" minOccurs="0"/>
 </xsd:sequence>
 <xsd:sequence minOccurs="0">
         <xsd:element ref="GenSessKey" minOccurs="0"/>
  <xsd:element ref="ClientDt"/>
  <xsd:element ref="CustLangPref"/>
  <xsd:element ref="ClientApp"/>
  <xsd:element ref="ProxyClient" minOccurs="0"/>
  <xsd:element ref="EU.Cur" minOccurs="0"/>
  <xsd:element ref="ServerDt"/>
  <xsd:element ref="SessKey" minOccurs="0"/>
  <xsd:element ref="ExpDt" minOccurs="0"/>
  <xsd:element ref="Language"/>
 </xsd:sequence>
   </xsd:sequence>
</xsd:complexType>

TIA,
Marty