Considering you're using an XMLPull parser for deserializing objects, you might want to look at using JiBX (http://www.jibx.org) in combination with your framework. JiBX provides high-performance data binding using an XMLPull parser for unmarshalling. This should eliminate the need for users to write their own MessageReader and MessageWriter implementations in your framework (they'd need a binding definition, but that's generally a lot simpler to write and maintain than the actual code).
An ideal solution for message style would couple a data binding framework with the SOAP framework so that there are no added conversions to and from text. I think that's what's planned for the integration between JAX-RPC and JAXB coming down the line. I gather that both SMFW and the current Castor binding support actually go through multiple conversions to and from text (since AFAIK Axis always parses everything going in both directions, before converting back to text), which is going to really hurt performance.
- Dennis
Dennis M. Sosnoski Enterprise Java, XML, and Web Services Support - http://www.sosnoski.com JiBX Lead Developer - http://www.jibx.org Redmond, WA 425.885.7197
Naresh Bhatia wrote:
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
