Cory,

Theoretically, the answer to your question is yes. But practically when
I tried this in the past, Castor mapping approach could not handle the
complexities of my data structures. So I use an XML Pull parser to
serialize / deserialize my business objects. You can look at my detailed
implementation at http://smfw.sourceforge.net/. It is open source - feel
free to use it in your projects.

Regards,
Naresh

-----Original Message-----
From: Cory Wilkerson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 5:01 PM
To: [EMAIL PROTECTED]
Subject: castor & axis & marshalling


As a follow up to Anne's post, dated 08/04 11:20:28 -- specifically:
"Castor performs translations from xsd types to Java objects."  For
those of you familiar enough with Castor -- I've a question.  

Just a disclaimer -- sorry for the Castor slant here -- I'm just looking
for someone to say, "yes you can accomplish this" or "no, you can't".

Let's suppose I implement my service as a message style service and I'm
handed the soap envelope by Axis.  Also, let's assume I have a set of
classes in my domain that I'd like to flesh out with the data
represented in the soap body.  My question is whether or not I can use
Castor to marshall/unmarshall this data for me given a mapping file or
do I have to rely on Castor generated classes/marshalling framework to
handle this?  For example, if in my <types> I've defined the following:


<xsd:complexType name="Person">
        <xsd:sequence>
                <xsd:element name="firstName" type="xsd:string"/>
                <xsd:element name="lastName" type="xsd:string"/>
                <xsd:element name="birthDate" type="xsd:date/>
        </xsd:sequence>
</xsd:complexType>

And someone invokes my services and passes me type "Person" -- is there
a convenient way via Castor to map it into object type Foo?

class Foo {
        private String fName
        private String lName
        private Calendar dateOfBirth

        public get/setFName
        public get/setLName
        public get/setDateOfBirth
}

Thanks yet again!
Cory

Reply via email to