axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Sosnoski <...@sosnoski.com>
Subject Re: Data binding frameworks that allow backwards compatible schema changes?
Date Wed, 18 Apr 2007 01:17:15 GMT
Hi Amila,

When I try running the 1.2RC2 WSDL2Java with -d jaxbri I get:

     [java] Exception in thread "main" 
org.apache.axis2.wsdl.codegen.CodeGenerationException: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
     [java]     at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:255)
     [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
     [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
...
     [java] Caused by: java.lang.NullPointerException
     [java]     at 
org.apache.axis2.jaxbri.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:105)
     [java]     ... 8 more

This is the same error I got when I tried with RC1, as reported in Jira: 
https://issues.apache.org/jira/browse/AXIS2-2431 The same WSDL (and 
schema) works fine with ADB and JiBX data bindings.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Amila Suriarachchi wrote:
>
>
> On 4/17/07, *Dennis Sosnoski* <dms@sosnoski.com 
> <mailto:dms@sosnoski.com>> wrote:
>
>     JAXB 2.0 should do this, though I was unable to get JAXB to work with
>     the Axis2 1.2RC1 WSDL2Java. Has anyone been successful in using JAXB
>     with Axis2?
>
>
> Can you test with RC2? Are you refering the bug which does not include 
> jaxb- runtime jars and jaxb template to
> axis2-jaxb.jar?
>
>     JiBX will also handle this. Unlike JAXB 2.0, with JiBX it's not the
>     default behavior. In the JiBX binding you need to set
>     flexible="true" on
>     any <mapping> or <structure> element where you want to allow unknown
>     elements.
>
>     In general it's not a good approach to do this kind of schema
>     extension
>     (especially for web services, where the schema definition should
>     be part
>     of the service contract). If you want to allow for extensions, use an
>     xs:any element as a wildcard that allows for other elements to be
>     added
>     in the future. Otherwise you're not actually following the schema,
>     which
>     defeats the whole purpose of having one in the first place.
>
>       - Dennis
>
>     Dennis M. Sosnoski
>     SOA and Web Services in Java
>     Training and Consulting
>     http://www.sosnoski.com - http://www.sosnoski.co.nz
>     Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>
>     Amila Suriarachchi wrote:
>     > As I understood you are looking for an databinding framwork
>     which does
>     > not do any validation. try jaxb.
>     >
>     > On 4/16/07, *Josh* < gemini929@gmail.com
>     <mailto:gemini929@gmail.com> <mailto:gemini929@gmail.com
>     <mailto:gemini929@gmail.com>>>
>     > wrote:
>     >
>     >     Amila,
>     >
>     >     If I configure a databinding approach to work with the
>     following XML:
>     >
>     >     <person>
>     >         <firstName>John</firstName>
>     >         <lastName>Doe</lastName>
>     >     </person>
>     >
>     >     Which databinding approaches will not break if I pass in the
>     >     following XML:
>     >
>     >     <person>
>     >         <firstName>John</firstName>
>     >         <lastName>Doe</lastName>
>     >         <age>25</age>
>     >         <sex>M</sex>
>     >     </person>
>     >
>     >     While most client applications may not want to interpret the new
>     >     information, I want to make sure that I can recommend a binding
>     >     approach that does not cause a ripple effect when new items are
>     >     added to the schema.  Does this clarify what I am looking for?
>     >
>     >     -Joshua
>     >
>     >
>     >     On 4/16/07, *Amila Suriarachchi*
>     <amilasuriarachchi@gmail.com <mailto:amilasuriarachchi@gmail.com>
>     >     <mailto:amilasuriarachchi@gmail.com
>     <mailto:amilasuriarachchi@gmail.com>>> wrote:
>     >
>     >
>     >
>     >         On 4/14/07, *Josh* <gemini929@gmail.com
>     <mailto:gemini929@gmail.com>
>     >         <mailto:gemini929@gmail.com
>     <mailto:gemini929@gmail.com>>> wrote:
>     >
>     >             All,
>     >
>     >             I am looking to determine which client side data
>     binding
>     >             choices (castor, jibx, jaxb etc) allow backwards
>     >             compatible schema changes (eg addition of a new field)
>     >             without throwing an exception.
>     >
>     >
>     >         What you exactly mean by backword compatible schema?
>     >         e g.  if you add a new element to a complex type with
>     >         minOccurs 0 then this should work properly with  the
>     requests
>     >         you got earlier as well. But in this case it the way you
>     write
>     >         schema and it has nothing to do with the databinding frame
>     >         work as far as it correctly interpret the schema.
>     >
>     >
>     >             I am hoping to recommend some solutions to my
>     clients that
>     >             would allow me to make backward compatible schema
>     changes
>     >             without causing a ripple effect.  Has anyone come across
>     >             this information?
>     >
>     >             Regards,
>     >
>     >             Joshua
>     >
>     >
>     >
>     >
>     >         --
>     >         Amila Suriarachchi,
>     >         WSO2 Inc.
>     >
>     >
>     >
>     >
>     >
>     > --
>     > Amila Suriarachchi,
>     > WSO2 Inc.
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>     <mailto:axis-user-unsubscribe@ws.apache.org>
>     For additional commands, e-mail: axis-user-help@ws.apache.org
>     <mailto:axis-user-help@ws.apache.org>
>
>
>
>
> -- 
> Amila Suriarachchi,
> WSO2 Inc. 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message