I am using AXIS2 tomcat6 and jre1.6.0_07 and I created java project using net beans. but when I execute java2wsdl I am getting the following. Can you solve my problem? Also I would like to know what is the function of java2wsdl and its parameters?Thanks C:\axis2-1.4-bin\axis2-1.4\bin>%AXIS2_HOME%\bin\java2wsdl -cp . -cn samples.quickstart.service.pojo.StockQuoteService -of StockQuoteService.wsdl Using AXIS2_HOME: c:\axis2-1.4-bin\axis2-1.4 Using JAVA_HOME: C:\Program Files\Java\jre1.6.0_07 An error occured while generating codejava.lang.ClassNotFoundException: samples.quickstart.service.pojo.StockQuoteService
1) Why are you using, %AXIS2_HOME%\bin\java2wsdl. You are already inside C:\axis2-1.4-bin\axis2-1.4\bin, so you would just use java2wsdl.
2) Classpath: You are trying to use the class named samples.quickstart.service.pojo.StockQuoteService. But you have set your classpath (-cp option) to "." which means your program should look for the .class file inside the current directory. Where have you saved your .class files?
First off , you must enter to the directory of StockQuoteService class and compile (in my case C:\axis2-1.6.2\samples\quickstart\src \samples\quickstart\service\pojo).
Then enter to src folder ( C:\axis2-1.6.2\samples\quickstart\src) to execute the command and this generate the WSDL file into such folder.
Remember that '-cp .' indicates the actual directory and '-cn'
specifies the qualified name of the class.
It is because the java2wsdl.sh actually try to convert the class file to wsdl instead of java file.
you have to switch to the build directory which have the related class file, then run the generation should success.
the class file is located in : classes/samples/quickstart/service/pojo/StockQuoteService.class
then : cd classes && $AXIS2_HOME/bin/java2wsdl.sh -cp . -cn samples.quickstart.service.pojo.StockQuoteService -of test.wsdl
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop