title: Where to use wsgen?
body: <p>Don't seem to know where (what directory - source or classes) to properly use wsgen against my WebService class...</p>
  
  <p>Create a sample document literal based WebService:</p>
  
  <pre><code>package hello;
  
  import javax.jws.WebService;
  
  @WebService
  public class HelloWorld {
  
  public void sayHello() {
          System.out.println("Welcome to JAX-WS 2!");
      }
  }
  </code></pre>
  
  <p>Created the Publisher like this:</p>
  
  <pre><code>package hello;
  
  import javax.xml.ws.Endpoint;
  
  public class Publisher {
      public static void main(String[] args) {
          Endpoint.publish("http://localhost:8080/jaxws/hello", new HelloWorld());
      }
  }
  </code></pre>
  
  <p>Using Eclipse Helios, I automatically build both of these files as *.classes underneath the corresponding classes directory.</p>
  
  <p>So, from the filesystem, my project looks like this:</p>
  
  <pre><code>/code/jws_sample
            |
            src
               |
                hello
                    |
                    HelloWorld.java
                    Publisher.java
            |
             classes
                      |
                      HelloWorld.class
                      Publisher.class
  </code></pre>
  
  <p>In which directory would I run wsgen?</p>
  
  <p>When I tried it inside:</p>
  
  <p>/code/jaxws_sample/src/wsgen -cp . hello.HelloWorld</p>
  
  <p>Received:</p>
  
  <pre><code>  Class not found: "hello.HelloWorld"
  
    Usage: WSGEN [options] &lt;SEI&gt;
  
    where [options] include:
  
    -classpath &lt;path&gt;          specify where to find input class files
  
    -cp &lt;path&gt;                 same as -classpath &amp;lt;path&amp;gt;
  
    -d &lt;directory&gt;             specify where to place generated output files
  
    -extension                       
                               allow vendor extensions - functionality not specified
                               by the specification.  Use of extensions may
                               result in applications that are not portable or
                               may not interoperate with other implementations
     -help                     display help
  
     -keep                     keep generated files
  
     -r &lt;directory&gt;            resource destination directory, specify where to
                               place resouce files such as WSDLs
  
     -s &lt;directory&gt;            specify where to place generated source files
  
     -verbose                  output messages about what the compiler is doing
  
     -version                  print version information
  
     -wsdl[:protocol]          generate a WSDL file. The protocol is optional.
                               Valid protocols are [soap1.1, Xsoap1.2],
                               the default is soap1.1.
                               The non stanadard protocols [Xsoap1.2]
                               can only be used in conjunction with the
                               -extension option.
  
     -servicename &lt;name&gt;       specify the Service name to use in the generated WSDL
                               Used in conjunction with the -wsdl option.
  
     -portname &lt;name&gt;          specify the Port name to use in the generated WSDL
                               Used in conjunction with the -wsdl option.
  
     Examples:
  
     wsgen -cp . example.Stock
     wsgen -cp . example.Stock -wsdl -servicename {http://mynamespace}MyService
  </code></pre>
  
  <p>It actually does show me the WSDL in a browser and also when I tried to issue the wsgen command from $MyProject/classes it actually did create a jaxws folder with the SayHelloResponse.class files but not the SayHelloResponse.java files?</p>
  
  <p>Thank you for taking the time to read this.</p>