Hello Werner,

I am using latest stable Castor release 1.1.2.1, Axis2 is 1.3. I think that 
this is not an Axis issue beacause in my example objects are are already 
marshalled incorrectly before I send an XML structure over web service.

I use code generator from Ant, running it like this:
        <castor-srcgen
                dir="wsdl/xsd"
                todir="${client.target}/src"
                package="${schema.package}"
                testable="no"
                warnings="false"
                types="j2"/>

Vadim


-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 23, 2007 11:16 AM
To: [email protected]
Subject: Re: [castor-user] Problem with marshalling generated enumeration 
objects

What version of Castor (and Axis) are you using, if I may ask ?

Werner

Lositski Vadim wrote:
> Hello,
>
> I have a simpletype in my XML schema:
>
> <xs:simpleType name="ST_Typename">
>   <xs:restriction base="xs:string">
>         <xs:enumeration value="VALUE1" />
>         <xs:enumeration value="VALUE2" />
>         ...
>   </xs:restriction>
> </xs:simpleType>
>
> I generate Java files using Castor Source Generator and a proper enum-like 
> Java class is generated for this complexType.
> Then I use other castor-generated class for storing values of this 
> enumeration, and then marshall it like this:
>
> SomeContainer c = new SomeContainer();
> c.setSomeValue(ST_Typename.VALUE1);
> c.setSomeStringValue("Hello world!");
>
> FileWriter writer = null;
> try {
>     writer = new FileWriter("output.xml");
>     response.marshal(writer);
> } catch (Exception e) {
>     e.printStackTrace();
> }
>
> Problem is that the field "someValue" of the type "ST_Typename" is not 
> marshalled and does not exist in an XML file, however string property is 
> correctly marshalled.
> I am using Castor in combination with Axis2 and it is needed to serialize 
> this object and deseirialize to the same type of Castor-generated class on 
> the other side of the net.
>
> Please give me an advice concerning the solution for this problem. Should I 
> use some custom mapping settings?
>
> Best regards,
> Vadim
>
> ---------------------------------------------------------------------
> 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


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

    http://xircles.codehaus.org/manage_email

Reply via email to