Richard,

when you generated Java sources from your XML schema, the code generator
generated two sets of classes:

a) your domain classes (as outlined below)
b) descriptor classes.

Did you package the latter ones as well with your application ? It looks
 to me like this might not be the case.

Regards
Werner

PS Why not try to marshal useful XML from a sample object instance ?
Usually this indicates if something is wrong with e.g. configuration,
missing descriptor classes, ....

Wells, Richard wrote:
> I am trying to implement Castor to put XML requests into a Java object.
> On a very simple input request, I was able to make it work, but I have
> an issue now with moderately more complex ones.
> 
> I used the source generator tool to create classes from a schema file
> for the request. The XML request itself looks like this.
> 
> <GetAccountBalancesRequest>
>   <MSSTInd>false</MSSTInd>
>     <Accounts>
>       <Account>
>         <AcctNo>X10152382</AcctNo>
>         <CESGInd>false</CESGInd>
>       </Account>
>       <Account>
>         <AcctNo>X10625310</AcctNo>
>         <CESGInd>false</CESGInd>
>       </Account>
>     </Accounts>
> </GetAccountBalancesRequest>
> 
> The Schema for that looks like this.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> <xsd:element name="CESGInd" type="xsd:string"/>
> <xsd:element name="GetAccountBalancesRequest">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="MSSTInd"/>
> <xsd:element ref="Accounts"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="AcctNo" type="xsd:string"/>
> <xsd:element name="MSSTInd" type="xsd:string"/>
> <xsd:element name="Account">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="AcctNo"/>
> <xsd:element ref="CESGInd"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="Accounts">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" ref="Account"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> 
> I ran the SourceGenerator to create the classes, and ended up with an
> Account, Accounts, and GetAccountBalancesRequest java files.
> 
> I put those in place in my code, and run it something like this.
> 
> GetAccountBalancesRequest inputRequest = new
> GetAccountBalancesRequest();
> inputRequest= GetAccountBalancesRequest.unmarshal(new
> StringReader(xmltmp));
> 
> When I do that, and look at the contents of inputRequest, the MSSTInd
> field is populated ok, but the accounts are null. It seems it's doing on
> with the simple elements, but not properly dealing with the complex
> elements.
> 
> Anyone do anything similar, and run into these issues? Something else I
> should be doing here that I'm missing? This is my first try at using
> Castor like this.
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to