0

I'm trying to run this shell script:

set class=com.example.Greeting
set clpth=./war/WEB-INF/classes 
set resourcedir=./war 
set outsourcedir=./src 
set outdir=./war/WEB-INF/classes 
wsgen -cp "%clpth%" -wsdl -keep -r "%resourcedir%" -d "%outdir%" -s "%outsourcedir%"  %class% 

So, I copy each line in the cmd but when I copy the last line, this error appears:

"'wsgen' is not recognized as an internal or external command, operable program or batch file."

This is a shell script for a Web Service application in App Engine. I'm following this tutorial https://developers.google.com/appengine/articles/soap?hl=es but I don't know how to do the step called: 4. Run wsgen on the annoted class

Thanks!

Natiya
  • 463
  • 2
  • 9
  • 25

1 Answers1

2

Add

PATH=%path%;C:\Program Files\jdk6u30\bin

to the to top of the script. Change the path as necessary so that it points to the actual location of wsgen.exe.

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
  • Thank you so much!! It works...however now I have this error: – Natiya May 06 '12 at 17:29
  • "directory not found.\war"...also I've checked my version: JAX-WS RI 2.1.6 in JDK 6...what can I do to generate the classes in the war folder?? thanks!! – Natiya May 06 '12 at 17:36
  • The tutorial says that "clpth='./war/WEB-INF/classes' – tells wsgen where to find com/example/Greeter.class", i.e., it is looking for the class file built from the sample code. So you should just need to compile the sample code to create this class file. – Harry Johnston May 06 '12 at 20:21
  • Yeah, I've runned it... I thought this: should the project and the jdk be in the same folder?? And other point is: I can't see in Eclipse the "classes" folder, but I can see ot in the folder of my project...if I try to copy it to Eclipse, I can't do it because it says that the source and destination are the same. Any idea?? thank you! – Natiya May 07 '12 at 19:57
  • Also I've tried to compile my class from the cmd, by writing the path of my poject, but "javac" is not recongnized as a command and if I write "java Greeting.java" it says that the class Greeting is not found. Also I've tried with " java Greeting" but the same error appears... – Natiya May 07 '12 at 20:45
  • The same PATH command given in my answer will put javac on the path so that you can use it to compile your class from the command line, although you should be able to do this from Eclipse more easily. The java command runs existing class files, it does not compile java source files into class files. – Harry Johnston May 08 '12 at 02:54
  • I'm not very familiar with Eclipse so I don't know why it isn't showing you the classes folder, perhaps it just hides it because you never need to manually open or save files in it. Perhaps you should look for a tutorial on using Eclipse with Java? The Eclipse web site might be a good place to start. – Harry Johnston May 08 '12 at 02:58
  • It is unlikely in my opinion to be necessary to put a copy of the jdk in the project folder. – Harry Johnston May 08 '12 at 02:59
  • In my opinion it is also unlikely. Look, this person had a problem very similar: http://stackoverflow.com/questions/9598533/wsgen-not-creating-wsdl-file – Natiya May 08 '12 at 08:25
  • I mean: he is compiling the class from the cmd and also it seems he's executing wsgen from the same folder...Anyway, this is what I'm do it: in the cmd, I change the directory to Program Files\jdk6u30\bin, then, I copy the commands I've written in my first post and the error, when I execute wsgen is "directory not found.\war". So, you told me, firstly, I have to compile the code...I've runned it from Eclipse (everything was ok) but the error appears again, then I've tried to execute the Greeting class from the cmd, but I couldn't...Also I have the jdk and the project in different folders... – Natiya May 08 '12 at 08:32
  • That was a summary of my problem, because I thought my comments were becoming a mess!!! thank you so much for your help!! Oh, I've forgotten to tell you: I think the problem is not the classes folder doens't appear on Eclipse, only I didn't know what to think! thanks! – Natiya May 08 '12 at 08:34
  • I have no more ideas at this point. The original problem is solved, so I suggest you ask a new question, something along the lines of "how do I use wsgen on an annoted class" so that hopefully it will attract the attention of those familiar with this technology. – Harry Johnston May 09 '12 at 00:55
  • just in case somebody stumbles upon this thread, windows starts the script in the **eclipse** root folder. so you need to change the path to the **project** root folder. add something like _"cd c:\users\user\workspace\project\"_ to the script **before** the wsgen command. – user1097489 Mar 06 '13 at 06:53