I had a similar (but much more complex) problem when dealing with purely dynamic types (converting a Map to an arbitrary complex type) and vice versa. The problem is, TypeDesc implicitly auto-discovers fields in your class/bean using reflection. What needs to be done, an I would lobby Axis developers to do so:

* add setBeanPropertyDescriptors(BeanPropertyDescriptor[]) method to TypeDesc
* add setPropertyMap(Map) method to TypeDesc


Explicitly set BeanPropertyDescriptor array and property map should OVERRIDE any avoid any implement discovery through reflection.

This way you can register the the BeanSerializerFactory/BeanSerializer and BeanDeserializerFactory/BeanDeserializer with an appropriate TypeDesc.

I suppose what you would do in your case is define a property descriptor map that returned an arbitrary BeanPropertyDescriptor that simply consumed the "invalid" value.

Aaron Hamid
CIT/I&D
Cornell University

Phil Shrimpton wrote:

Hi,

We are using a Webservice from a third party using Axis at our end.

The Third-Party keeps adding elements to complexTypes in methods we are using, which causes our software to break (Invaild Elemenet....) during deserialization of the complexType they have added the element to.

Of course we complain, but the reply is "There is no problem adding elements to complex types, as you can just ignore them. Our other customers don't have any problems"

So how do I ignore these extra elements in Axis?

Phil




Reply via email to