31

I have a wsdl named as abc.wsdl

when I tried to generate the SEI Interface java files by this command

wsimport abc.wsdl

It generates .class files in package path a.b.c.d

but it has not generated any .java files .

Can you please tell me Why I was not able to generate the .java files ?

Actually I am new to .wsdl files.

Is it specified somewhere in .wsdl file to generate .class file and not .java file ?

AND

How I can generate .java file ?

3 Answers3

50

wsimport utility from JDK 1.7 does generate java files but removes them after byte-code generation leaving class files only. You can use option -keep to specify that you want to have both.

wsimport -keep http://example.com/webservice?wsdl
Aleksandr Kravets
  • 5,750
  • 7
  • 53
  • 72
40

If you don't need classes, you can use -Xnocompile option of wsimport tool.

Michael Berry
  • 70,193
  • 21
  • 157
  • 216
Aram Paronikyan
  • 1,598
  • 17
  • 22
15

By default wsimport generates only classes but it can be used to generate sources too with -s flag. For example make a folder src to your to-be-generated classes root folder and execute a command like this:

wsimport -s src http://example.com/webservice?wsdl

This way your classes will be as before but your sources will be on src folder. Additional info about different wsimport flags can be found by entering wsimport -help on command line.

Tarmo
  • 3,851
  • 2
  • 24
  • 41