nisi
nisi

Reputation: 1

generate webservice template from WSDL file with help of java code

I have WSDL file locally in my machine and using WSDL file I wanted to generate the web-service template in separate file, So later I can change tag values based on need. Not sure which jar files, settings and javacode are required in java to generate web service template in separate file using WSDL file.

Upvotes: 0

Views: 1023

Answers (3)

Jagath Ariyarathne
Jagath Ariyarathne

Reputation: 95

You can generate Java classes from WSDL file using axis2. Download axis2 binary distribution. Go to bin directory. Execute below command with correct file paths according to your requirement.

./wsdl2java.sh -uri <WSDL File Path> -o <Destination folder for Java files>

Example:

./wsdl2java.sh -uri Mytest.wsdl -o myservice

This will create java files in "myservices" folder in axis2 bin directory, using the WSDL file located in bin directory of axis2.

If your WSDL file and the target folder is not inside bin directory of axis2, put absolute paths for those parameters in the above command.

Upvotes: 0

dReAmEr
dReAmEr

Reputation: 7196

I think below should work for you.

wsimport -s src http://<ip address>:<port>/test?wsdl

-s specifies the location where you want to place source file.

or if your wsdl file is locally present,you can try below.

wsimport -keep -wsdllocation /<path to wsdl file>/MyService.wsdl

For more reference wsimport

Upvotes: 0

vincent
vincent

Reputation: 1234

If i understand correctly, you want to generate the Java class files from your WSDL, right ? If you use metro, you have to go in the bin directory of metro. Then, you have to use "wsimport.sh -s " if you're on windows try wsimport.bat instead of wsimport.sh

Upvotes: 1

Related Questions