Quoting James Black <[EMAIL PROTECTED]>:

> > -----Original Message-----
> > From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, January 01, 2004 1:33 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: null pointer problem in both 1.1 and 1.2alpha
> >
> > 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!
> 
>   I know that axis supports ints as my web services use them. <g>
> 
>   I use junit extensively in my development, and one thing I found very
> helpful is to write a separate unit test for the server stub, then for the
> client side (the client side actually connects to the server).  It sounds
> like you sre using httpunit for the client side, and you may want to use
> junit.
> 
>   Your project is actually something that would be very useful, so I hope
> this problem can be figured out.
> 
>   Is it possible that httpunit could be causing the problem? You may want to
> explain more about your test procedure, and perhaps include the source code
> for unit test that is causing the problem.
>   I have never tried using httpunit for testing the client side, but that
> would imply that you are using some sort of cgi program, which wouldn't make
> sense, since we are using webservices.
> 

Actually, the only unit test I used was the one provided by the tutorial.  I 
have not written a unit test for anything else.  My observation is strictly 
limited to my manual testing of the web service.  askQuestion(String) works 
perfectly, and askQuestion(String, int) fails with the null pointer exception 
that I posted when running a simple client that I wrote.

Is it possible that differences in options I provide to java2wsdl and wsdl2java 
ant tasks might make a difference?  Would it help if I posted the wsdl 
generated by Axis?  I really have very little idea of where to look for the 
cause of this issue as I am pretty new to Axis and webservices in general and I 
am not doing anything fancy here anyway.

Well, I'll go ahead and attach a zip file with the full working build and 
copies of both generated wsdl files.  
Maybe someone will see something that looks like it might be suspect.

Note again, that this is all based on the tutorial at...
http://www.relevancellc.com/hands-on/MagicBall/

The build assumes that a "axis-1_2alpha" directory exists in the root of the 
buld so you'll have to provide that (or change the axis.home property to point 
to your copy of 1.1 or 1.2alpha).  To generate the wsdl and java, compile, and 
deploy the web service, just type "ant deploy-server".  Then you'll need to 
build the client by typing "ant compile-client".  Then run the class located 
in "client/classes" (source is in "client/src") and supply the information it 
requests.  You should see the null pointer exception that I posted previously.  

To see it working, just modify the MagicBall classes to not take the extra int 
parameter.  Do an "ant clean" and all the above again and it should now work 
perfectly.

It would be excellent if someone with more knowlege of Axis could verify this 
problem.  Again, maybe I'm just missing something painfully obvious to a more 
experienced user.

Thanks,

Jake

Attachment: MagicBallStarter.zip
Description: Zip compressed data

Reply via email to