You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Phil Shrimpton <ph...@shrimpton.co.uk> on 2004/01/21 15:29:03 UTC

Ignoring Elements in be deserialization

Hi,

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

The Third-Party keeps adding elements to complexTypes in methods we our 
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

-- 
                         Discover a lost art - play Marbles
                                     April 2004
ICQ: 760757 | AIM: pjshrimpton | Y!: pjshrimpton | pjshrimpton@jabber.org

Re: Ignoring Elements in bean deserialization

Posted by Aaron Hamid <ar...@cornell.edu>.
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
>