This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have written a very simple web service on my local machine. Am using Tomcat w/Apache Axis to implement the same. I coded a very simple *.jws file in the Tomcat webapp directory. The file has two very simple public methods. With Tomcat & Axis, I was able to see the wsdl of the web service on my browser. That said, I started with the client. I generated the stub classes & interfaces (2 each) using the WSDL2Java tool and moved those generated classes in my workspace. Once done, I tried to run my client from the command line (Actually, I am using Eclipse IDE). The client is able to locate the service but throws a NullPointerException on the Call.Invoke method. ( I see this in the Stacktrace). I checked the Apache Axis docs for troubleshooting and found that it might be the Validation library (Crimson, by default) or the fact that the client and server are both on local server. I downloaded Xerces and referenced it in my project. I just do not understand why there is an issue with the client and the server being on the same local host. Does this mean that if the web service is on a remote machine, I wont run into this issue? Please help.
- Himanshu PS> I am using the first example from the 'Real web services' book and having this issue.
Can you post the snippet of your error details. Also try to use some tcpip sniffers like Apache SOAPTCPMonitor from Axis or TCP/IP Trace from also www.pocketsoap.com, this will tell what messages sent btwn client and server and where exactly the error occurs.
You mentioned that you run your client in your workspace. You might have some jar files which contain older versions of some classes which axis uses now. For example, I encounter a similar problem because my workspace contains jaxm.jar(from 2003) which has the same set of classes as saaj.jar which comes with axis. As soon as I removed the jaxm.jar, everything runs fine. I even wrote a utility myself to inspect jar files under a directry and list which classes apear in more than one jar files.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Axis Web Service Client : NullPointerException