1

I have a problem with the installation of Java2Wsdl tool.

I have succesfully created and compiled(generated the .class file from the .java file) a simple Java class inside a directory /home/user/examples/com/mycompany/app. In there I compile my SimpleClass and so, I have two files: SimpleClass.java & a SimpleClass.class .

Next, I have axis2/c installed on my ubuntu system

$ echo $AXIS2C_HOME
/usr/local/axis2c

I also have axis2/java installed

echo $AXIS2_HOME
/opt/axis2-1.6.2

I also downloaded, extracted and installed from this link the java2wsdl plugin.

This is how the bin directory looks like. username@usernamePC:/opt/axis2-1.6.2/bin$ ls
axis2.bat axis2server.sh java2wsdl.bat setenv.sh wsdl2java.sh axis2server.bat axis2.sh java2wsdl.sh wsdl2java.bat

Now, I want to convert my initial project from java to wsdl with java2wsdl but I cannot understand the right place of directory I should put that into, if I have the classpath(?) right and what would be the correct command for the conversion to happen.

I am trying something like that:
Java2WSDL.sh -cn com.mycompany.app.SimpleClass In here I put . instead of / and I am typing that in top directory, meaning com directory.

Can you help me out with this? I am sorry for the long question but I needed to set all things right.

my-app was build with a simple maven project (maven 2.2.1) through this guide.

4

1 回答 1

3

您应该从build/classes目录开始代码生成。该目录必须有comMETA-INF子目录。

生成 WSDL 的示例:

# compile your project using ant or mvn
ant
# go to binary dir
cd build/classes
# check SimpleClass.class is here
ls com/mycompany/app/SimpleClass.class
# generate WSDL into current directory
$AXIS2_HOME/bin/java2wsdl.sh -cn com.mycompany.app.SimpleClass
# see generated WSDL
cat SimpleClass.wsdl

要将 WSDL 生成到不同的目录,请将开关附加到脚本-o <directory>的命令行。wsdl2java.sh

于 2013-08-02T13:57:08.420 回答