Webservice n00b needs Axis assistance.
April 19, 2006 7:01 PM
Subscribe
So I'm trying to implement a webservice for a class project using Apache Axis, and I'm having some weird classpath (I think) issues.
The problem is as follows: I've written a servlet which runs fine by itself, and I'm wanting to implement it as a full-on webservice. The code compiles fine, the WSDL generated fine (a few minor warnings, but nothing that looks bad), but when I try to run WSDL2Java to generate the code:
java org.apache.axis.wsdl.WSDL2Java -o . -dSession -s -Strue -Nurn:phonebook phonebook phonebook.wsdl
I get this:
java.io.IOException: Type {http://http.servlet.javax}HttpServletResponse is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:665)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Thread.java:595)
Here's the classpath (it's messy, because I've been fucking about with it, trying to make it work):
.:/home/cpsc4373:/usr/tomcat/webapps/examples/WEB-INF/classes:/home/cpsc4373/axis-1_3/lib/axis.jar:/commin/lib/saaj.jar:
/home/cpsc4373/axis-1_3/lib/commons-logging-1.0.4.jar:/home/cpsc4373/axis-1_3/lib/commons-discovery-0.2.jar:
/home/cpsc4373/axis-1_3/lib/wsdl4j-1.5.1.jar:/usr/tomcat/WEB-INF/lib/servlet.jar:/home/cpsc4373/axis-1_3/compile:
/home/cpsc4373/axis-1_3/samples/userguide/example6:/usr/tomcat/common/lib/:/usr/tomcat/common/lib/javax/servlet/http/:
/home/cpsc4373/axis-1_3/compile/phonebook
Which leaves me smack in the middle of WTFistan. Not to mention that Googling the first line of the error message turns up precisely zero responses. Which is the internet's way of saying STFU NOOB, I know. But this is for a project grade, and the damn thing gotta work.
Background: This is on a RedHat Linux server, using the latest Java, Axis (not Axis2), Tomcat, and MySQL. I'm hell and gone from being a Linux admin, but one of my counterparts is fairly well-versed. I know how to do basic command line stuff and edit a .bash_profile, not terribly much more than that.
posted by middleclasstool to computers & internet (6 comments total)
An are you trying to expose the doGet() or doPost() methods as web services? This isn't what is usually done in the Java space as far as web services go. Typically people write some standalone class that has some business logic in it and then use Axis' tools to generate WSDL and to generate the config files needed to install the web service into the Axis runtime environment.
posted by mmascolino at 7:59 PM on April 19, 2006