ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Turner <tur...@genome.wi.mit.edu>
Subject Re: NullPointerException when serializing null String objects
Date Thu, 06 Dec 2001 15:27:07 GMT
Hi everyone,

The "NullPointerException" occurs when there's a null String object that's part
of the composition of another class.
For instance, I have a class called "MyClass" that contains two private
members: a String object and a URL object.  If I leave the String object inside
of "MyClass" null this is when the exception takes place.  Passing a null
String object by itself works.

I apologize if I didn't fully explain this correctly in my original email.

I'm enclosing the client code & any supporting code for this test.

David





Sanjiva Weerawarana wrote:

> No, that code was not the problem code- that was just a serializer
> he wrote. THe point is that the string serializer (cleanSer in
> SOAPMappingRegistry) is not invoked directly; its invoked via
> ParameterSerializer which handles the null.
>
> I'd still like to see what Apache SOAP 2.2 client code he wrote
> that caused the null strings to break.
>
> Sanjiva.
>
> ----- Original Message -----
> From: "Brian Gilman" <gilmanb@genome.wi.mit.edu>
> To: <soap-dev@xml.apache.org>
> Sent: Thursday, December 06, 2001 8:30 PM
> Subject: Re: NullPointerException when serializing null String objects
>
> > Hello all,
> >
> > I believe Dave already forwarded the code to this list. Please
> > take a look at this thread to find it.
> >
> > Best,
> >
> > -B
> >
> > -----------------------
> > Brian Gilman <gilmanb@genome.wi.mit.edu>
> > Sr. Software Engineer MIT/Whitehead Inst. Center for Genome Research
> > One Kendall Square, Bldg. 300 / Cambridge, MA 02139-1561 USA
> > phone +1 617  252 1069 / fax +1 617 252 1902
> >
> >
> > On Thu, 6 Dec 2001, Sanjiva Weerawarana wrote:
> >
> > > How did you serialize the string? If its a parameter to an RPC
> > > call the null value should be handled correctly.
> > >
> > > Can you post the code that shows the problem please?
> > >
> > > Sanjiva.
> > >
> > > ----- Original Message -----
> > > From: "David Turner" <turner@genome.wi.mit.edu>
> > > To: <soap-dev@xml.apache.org>
> > > Sent: Wednesday, December 05, 2001 10:36 PM
> > > Subject: NullPointerException when serializing null String objects
> > >
> > >
> > > >
> > > > I ran into a problem with SOAP's current String serialization when it
> > > > encounters null String objects.   I couldn't find anything in either
> the
> > > > user or dev archives regarding this so I don't know if this is a bug
> or
> > > > not.
> > > >
> > > > I ended up writing my own String serializer which handled the null
> > > > situation.  I only used my String serializer on the client side when
> > > > sending data to the service -- the soap service just uses the default
> > > > soap String serializer/deseralizer.   I have attached the source code
> > > > for my String serializer in case it can be incorporated into SOAP.
> > > >
> > > > What I would like to know is if this is currently an issue or not?
> Is
> > > > SOAP currently able to handle null String objects during serializing?
> > > >
> > > > Much appreciated.
> > > >
> > > > David
> > > >
> > > >
> > > >
> > > >
> > > > I
> > > >
> > > >
> > > >
> > >
> > >

--
David Turner <turner@genome.wi.mit.edu>
Senior Software Engineer
Whitehead Institute/MIT Center for Genome Research
One Kendall Square, Bldg. 300
Cambridge, MA 02139-1561 USA
phone 617-252-1573 / fax 617-252-1902


Mime
View raw message