no parecen saber dónde (en qué directorio - fuente o clases) para utilizar adecuadamente wsgen contra mi clase WebService ...Donde usar wsgen?
Crear un documento de muestra WebService basado literal:
package hello;
import javax.jws.WebService;
@WebService
public class HelloWorld {
public void sayHello() {
System.out.println("Welcome to JAX-WS 2!");
}
}
Creado el Editor de esta manera:
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());
}
}
Usando Eclipse Helios, construyo automáticamente ambos archivos como * .classes debajo del directorio de clases correspondiente.
Por lo tanto, desde el sistema de archivos, mi proyecto es el siguiente:
/code/jws_sample
|
src
|
hello
|
HelloWorld.java
Publisher.java
|
classes
|
HelloWorld.class
Publisher.class
En qué directorio iba a ejecutar wsgen?
cuando lo probé en el interior:
/código/jaxws_sample/src/wsgen -cp. hello.HelloWorld
Recibido:
Class not found: "hello.HelloWorld"
Usage: WSGEN [options] <SEI>
where [options] include:
-classpath <path> specify where to find input class files
-cp <path> same as -classpath <path>
-d <directory> 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 <directory> resource destination directory, specify where to
place resouce files such as WSDLs
-s <directory> 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 <name> specify the Service name to use in the generated WSDL
Used in conjunction with the -wsdl option.
-portname <name> 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
lo que realmente hace muéstrame el WSDL en un navegador y también cuando traté de emitir el comando wsgen desde $ miproyecto/clases que realmente hizo crear una carpeta con el jaxws Archivos SayHelloResponse.class pero no los archivos SayHelloResponse.java?
Gracias por tomarse el tiempo para leer esto.
Lo hice ... Eclipse creó el directorio de clases correspondiente y lo hizo así: $ MyProject/classes/wsgen -cp. hello.HelloWorld funciona, pero pone los stubs generados dentro de las clases dir. ¿Cómo se puede usar la -d para ponerlos dentro del directorio src? –