Pages

Saturday, March 12, 2005

Apache Axis WSDL2Java generator problem

I've been working on some Java web services using the Apache Axis toolkit. The WSDL2Java generator creates a static initializer in the server-side skeleton class that seems to be valid, compilable code. In our situation, we have two methods initially defined in our web service API, and invariably the second method would not be callable from a client test case. It didn't matter if you swapped the method order, the second method metadata (operation descriptions) would be goofed up and the method invocation would puke.

After spending several hours looking at code in the IDE and the debugger, I finally just refactored the static initializer to call two static methods, each setting up an exposed web service method in Axis. This simple method extraction refactoring fixed the problem, but I don't know what was causing the problem in the first place. Very odd stuff.

No comments:

Post a Comment