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?

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* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> 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* <[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:



        On 4/14/07, *Josh* <[EMAIL PROTECTED]
        <mailto:[EMAIL PROTECTED]>> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to