At 11:22 AM 1/1/2004 -0500, you wrote:
> -----Original Message-----
> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 31, 2003 3:21 PM
> To: [EMAIL PROTECTED]
> Subject: Re: null pointer problem in both 1.1 and 1.2alpha
>
> Just a follow-up to this...
>
> I did a test with a web service I've verified to work.  Basically, it is
> the
> same as one would create after following this tutorial...
> http://www.relevancellc.com/hands-on/MagicBall/
>
> It's one and only service method is askQuestion(String).  It takes a
> String and
> returns and String.  Like I said, this works fine.
>
> I then modified it to take two int parameters in addition to the String.
> I do
> nothing with them except add them to the interface.  So now I have
> askQuestion
> (String, int, int).  Just to be safe, I deleted my previous Axis webapp
> and put
> a fresh one in webapps and restarted Tomcat5.  I deployed the service
> fine, but
> then when I tried to access the service with my client, I got exactly the
> same
> exception as I originally reported.  This is entirely consistent the error
> in
> my other web service since it also took a String a two int parameters.
>
> So, what's the deal?  Can't I pass int's as parameters in a web service?
> Am I
> missing something here?

What do you pass as the string input?

  Are you using Junit to test your client side, and have you already done
unit tests on the server stub to ensure that that is working? The problem
may be happening on the server side and you are just picking up the null
pointer exception.


As I said before, When I had my service take only a String parameter, it worked perfectly fine. The Unit test worked and actually running the web service worked. I would pass a yes/no question such as "Are you cool?" and it would spit back one of its various magic ball answers (eg. "yes", "no", "maybe", etc....). I had no problems whatsoever until...


I added an int parameter to the askQuestion() method so it now looks like askQuestion(String, int). I changed all references to this to pass "1" (less the quotes, of course). I then called it just as explained above with the only difference being that I'm passing an int value (that I'm not even using inside the web service). And then *bang*, I get the null pointer exception reported.

BTW, the stack trace was copied from the server log, not the client so, yes, it is definitely happening server-side and, from what I can tell, somewhere inside the guts of Axis or the VM. The service method doesn't even get called.

Based on the fact that the service works perfectly with askQuestion(String) but fails with a null pointer exceptions simply by using askQuestion(String, int), the only conclusion I can draw is that Axis doesn't support int parameters. But that just can't be true, can it? Someone out there has to be using int parameters in their webservice methods. I've got to be missing something glaringly obvious.... or Axis has a serious bug, but I would think it would have bitten a lot of people so that the answer to my question would be obvious by now. Any further help is very much appreciated!

thanks,

Jake




Reply via email to