-------- Original-Nachricht --------
> Datum: Thu, 17 Apr 2008 11:51:34 +0530
> Von: Deepal jayasinghe <[EMAIL PROTECTED]>
> An: [email protected]
> Betreff: Re: [axis2] axis2 1.3 complextype with byte[] member variable, bug?

> Holger Uhlitzsch wrote:
> > Hi all,
> >
> > i think i found a bug in axis2 1.3 with POJOs.
> >   
> :)
> > My POJO has two methods. One sending a object with a byte[] member and
> one returning a object with byte[] member.
> > The serialization of the object is valid and i can see in the sending
> out soap message the base64 encoded byte[]. But the deserialization fails.
> >   
> What do you mean by fails ? did you get any exception ?

No i didn't get any exception. Let me explain a bit more.
The object i was using has two member first a int and second the byte[].
So in current implementation with parts.getParent() and 
beanElement.getFirstElement().getText() is not guarantee that the first xml 
element is the byte[]. In this case it was the int member so Base64.decode() of 
the int member with 0 as value returns an empty byte[].

XML example:

<arg1 xmlns=""
                                type="de.mytest.vo.Conta
inerVO">
                                <version>0</version>
                                
<_valueObjectByteArray>AApUZXN0U3RyaW5nc3IAEWphdmEubGFuZy5JbnRlZ=
                                </_valueObjectByteArray>
                        </arg1>

Can you follow me?

Regards Holger

> > In line 382 of class org.apache.axis2.databinding.utils.BeanUtil i have
> to change:
> >
> > partObj = deserialize(parameters, (OMElement)parts.getParent(),
> >
> > to:
> >
> > partObj = deserialize(parameters, parts,
> >
> > So i do not call deserialize() with the parent of parts (which is the
> xml element of the byte[] member).
> >
> > and in line 308 change:
> >
> > return Base64.decode(beanElement.getFirstElement().getText());
> >
> > to:
> >
> > return Base64.decode(beanElement.getText());
> >
> > Now i just have to call getText() to get the base64 encoded content of
> the byte[] xml element.
> >
> > I have to do this because call getFirstElement() doesn't ensure that the
> element is really the byte[] element.
> >
> > But i'm not sure this is the right fix.
> >   
> as I remember correct we have done some testing with ADB stub and POJO 
> services, however there we did not find any issues. So I need to double 
> check this and confirm.
> 
> Thank you!
> Deepal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to