code:
---------------------------------------------------------------------------
Web serviceRequest Response=========== ==========JAXB ^^^^^^^^^^XML to Obj JAXB Use external bindings to map Objects to and from XML (Schema)vvvvvvvvvv Obj to XML============ =========== Domain Logic Objects============ =========== Object-based SQL Server facadeObj to XML ^^^^^^^^^^translators XML to Obj JAXB assisted marshalling/unmarshallingvvvvvvvvvv translators possibly using your own XML Schemas========== ==========XML-based SQL Server API
---------------------------------------------------------------------------
External binding happens during compile time with the xjc compiler - so I don't see that having any impact on the deployment settings.
It may be worth looking at "pre-processing" those redefines out the schemas (people having to deal with them don't seem too fond of them) for JAXB - i.e. replacing the redefines with an "include" to a new schema file that is generated from the "original redefined" schema with all the redefinitions applied. JAXB won't care as long as the fully qualified names aren't affected.
Originally posted by Peer Reynders:
[QB]
Performance wise Castor is inferior to both versions of JAXB. It is also unclear how long Castor will be supported with JAXB being part of the JDK. The current non-JAXB favorite seems to be JiBX and it is supported by Axis 2. With JiBX you can sidestep the JAXB upgrade issue and possibly use Axis 2 as your front end. JiBX seems to have the best performance characteristics.
Originally posted by Peer Reynders:
[QB]
You should be able to do most of the XML/Java conversion through the use of external binding files. Then it is simply a matter of layering the responsibilities appropriately.
Thanks for thr reply. As of now I'm doing the 2nd option to created DTOs from schema objects. I'll look at the external binding option for jaxb. Is there any binding mapping that I need to configure in spring servlet xml file or while binding schema? Could not find any example for that.
About the converting the java objects to xml, yes I can use Adapter to translate the data in xml.
I tried to create the java objects with jaxb1, but the xsd file has <xs:redefine> tags which are not supported by jaxb1. Jaxb2 does support, but we have jaxb1 marshalling/unmarshalling jars being used by other applications. Not sure when they will upgrade to jaxb2. So I cant use jaxb2 as of now.
I'll be implementing castor for soap message & converting java to xml as another approach to test the performance.
Is there any better option to transalte java to xml (with jaxb1 for marhalling/unmarshalling soap message)?
Also if I have <xsd:redefine> in xsd file, the code generator doesn't generate java class with the name of xsd file. Instead it generates java classes for as many xsd files I have in <xsd:redefine> tag. Not sure how to generate xml out of so many classes. I believe any marshal method accepts xml file name & java class containing the data.
Thanks,
Sulabha