i would encourage you to take a look at the following article for a comparison involving Castor and JAXB. It does end up looking like an ad for Jibx, however...
http://www-106.ibm.com/developerworks/xml/library/x-databdopt2/ XMLBeans and XStream are a couple of other possibilities you might want to take a look at. -pc On Sun, 16 Jan 2005 18:20:11 -0800 (PST), Senaka Suriyaarachchi <[EMAIL PROTECTED]> wrote: > Hi Paul, > Can you give us some idea about the performance. > Comparing Castor and JAXB approaches. > > We decided to go with JAXB because if some > familiarities with us but we don't know about the > performance comparing Castor. > > BR > Senaka > > > --- Paul Callahan <[EMAIL PROTECTED]> wrote: > > > Hi Roger, > > > > There are a couple of ways that you can integrate > > the two (or Axis and > > any XML serializing mechanism for that matter). > > > > One way is discussed in this article by IBM... They > > are using Castor, > > but the underlying theme is the same. > > > > > http://www-106.ibm.com/developerworks/webservices/library/ws-castor > > > > Alternatively, you may use a "message" style > > service... This is from > > an earlier post: > > > > --- > > An alternative to creating a custom serializer is to > > use the > > doc/literal style service and use one of the 4 > > method signatures that > > Axis allows. You can inspect the incoming XML to > > determine what kind > > of message you have received. From there, use the > > utilities provided > > by the JAXB api to translate the XML message into > > JAXB objects, and > > perform your business logic. Then, create output > > objects using JAXB > > and serialize them to XML--return that from your web > > service method. > > So your webservice "controller" class could have a > > method like this: > > > > public Document doService(Document body) throws > > AxisFault { > > > > // inspect the document to see what "kind" of > > message you have received.. > > > > // deserialize the message > > jc = JAXBContext.newInstance(<your namespace>); > > u = jc.createUnmarshaller(); > > m = jc.createMarshaller(); > > requestObj = u.unmarshal(body); > > > > // perform your domain logic on this object > > > > // serialize and return your response > > returnDoc = XMLUtils.newDocument(); > > m.marshal(responseObj, returnDoc); > > > > return returnDoc; > > > > } > > > > --- > > > > As for reuse of the XSD within the WSDL, you are on > > the right track. > > You can use import statements in your WSDL to > > reference the XSD > > namespace. I have not generated wsdl for a doc/lit > > using JAXB > > before--but you should be able to by defining some > > interface class and > > using your JAXB objects... Then you would have to > > massage that output > > to use your XSD instead of the schema that is > > generated within the > > WSDL--someone please correct me if there is another > > best practice for > > that? > > > > Hope this helps a bit, > > pc > > > > On Fri, 14 Jan 2005 12:18:39 +0100, > > [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > In existing applications, I am using existing XML > > schema's. Also I use JAXB > > > to facilitate marshalling/unmarshalling in > > existing applications. Part of > > > this application functionality I would like to > > expose through SOAP. JAAS may > > > be used to create document/literal style messages > > however I would like to > > > use AXIS, since it better fits my needs. > > > > > > Therefore, I would like to try to include those > > existing schemas in my WSDL > > > file but how can I use AXIS document style and > > also use JAXB for object > > > serialization/deserialization? > > > > > > Who did this before? Some hints would be > > appreciated, an example would be > > > excellent? > > > > > > Roger Stoffers > > > Vodafone Netherlands > > > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >