If you add an endpoint property of: "set-jaxb-validation-event-handler" to "false"
then CXF will not add an event handler into the JAXB unmarshaller and the unexpected elements are silently ignored. You'll need to make sure the rest of the message is exactly correct though as you will not get any errors or anything if the message isn't correct. For example, the common thing to happen is someone sends qualified elements when JAXB is expecting unqualified elements. Without setting the handler, all the fields in the object would end up as "null". With the handler, you would get a message like: > unexpected element (uri:"http://my.namespace.com", local:"myField"). Expected > elements are <{}myField> so you can see that the namespace qualification is the reason. Dan On Sep 20, 2012, at 6:36 AM, tms.polgar <[email protected]> wrote: > Hi, > > I'm communicating with some SOAP webservices. > Unfortunately they change the response messages quite often, usually they > add some minor fields. > > I'd like to make cxf able to handle this. If I have an unexpected new field, > at the moment I'm getting > > Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"", > local:"myNewField"). Expected elements are <{}subType>,<{}value>,<{}type> > > As you can see I use JAXB for databinding. > > Does anybody have any idea how to manage it? > > Thank you. > Tamas > > > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/Tolerate-extra-fields-in-response-tp5714284.html > Sent from the cxf-user mailing list archive at Nabble.com. -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
