[WebService SOAP]JAX-WS : wsgen tool example

Cuando queremos enviar un wsdl a un cliente y no tenemos construido y publicado el webservice en un servidor de aplicaciones, la opción que nos queda es construir un proyecto web dummy para crear el wsdl, pero esto tiene una serie de inconvenientes ya que el XSD queda autogerenado al IDE que estemos usando, por ejemplo el IDE NetBeans 8.0.1 este ide utiliza la opción en de generar el wsdl con  la librería jaxws-ri ej:



    
    
        
        
        
        
        
            
        
    
    
        
            
        
        
            
        
    
    





Bajar libreria:

https://jaxb.java.net/2.2.11/


Para ejecutar el comando en linux:

JAXWS_HOME/bin/wsgen.sh -help


Syntax

wsgen [options] 
 
The following table lists the wsgen options:
OptionDescription
-classpath Specify where to find input class files.
-cp Same as -classpath .
-d Specify where to place generated output files.
-extensionAllow 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.
-helpDisplay help.
-JPass this option to Javac compiler. Note: use '=' instead of space as a delimiter between option name and its value.
-keepKeep generated files.
-r Used only in conjunction with the -wsdl option. Specify where to place generated resource files such as WSDLs.
-s Specify where to place generated source files.
-encoding Set the encoding name for generated sources, such as EUC-JP or UTF-8. If -encoding is not specified, the platform default encoding is used.
-verboseOutput messages about what the compiler is doing.
-versionPrint version information. Use of this option will ONLY print version information. Normal processing will not occur.
-fullversionPrint full version information. Use of this option will ONLY print version information. Normal processing will not occur.
-wsdl[:protocol]By default wsgen does not generate a WSDL file. This flag is optional and will cause wsgen to generate a WSDL file and is usually only used so that the developer can look at the WSDL before the endpoint is deploy. The protocol is optional and is used to specify what protocol should be used in the wsdl:binding. Valid protocols include: soap1.1 and Xsoap1.2. The default is soap1.1. Xsoap1.2 is not standard and can only be used in conjunction with the -extension option.
-servicename Used only in conjunction with the -wsdl option. Used to specify a particular wsdl:service name to be generated in the WSDL. Example:
-servicename "{http://mynamespace/}MyService"
-portname Used only in conjunction with the -wsdl option. Used to specify a particular wsdl:port name to be generated in the WSDL. Example:
-portname "{http://mynamespace/}MyPort"
-inlineSchemasUsed to inline schemas in a generated wsdl. Must be used in conjunction with the -wsdl option.
-x Used to specify External Web Service Metadata xml descriptor to be used. If there are more such files, the option must be used before each of those.
-XnocompileDo not compile generated Java files.
 

Example

wsgen -d stock -cp myclasspath stock.StockService 
This will generate the wrapper classes needed for StockService annotated with @WebService annotation inside stockdirectory.
wsgen -wsdl -d stock -cp myclasspath stock.StockService 
This will generate a SOAP 1.1 WSDL and schema for your Java class stock.StockService annotated with @WebService annotation.
wsgen -wsdl:Xsoap1.2 -d stock -cp myclasspath stock.StockService 
Will generate a SOAP 1.2 WSDL.

Como usarlo en un proyecto ya contruido?

Primero que nada debemos encontrar el classpath en donde estan todas los .Class :



 Ahora se ejecuta el comando en el wsgen:

sh /home/luxo/Descargas/WSDL/jaxws-ri/bin/wsgen.sh -verbose -keep -d /home/luxo/Descargas/WSDL/ -cp /home/luxo/WSQPS_MM/build/web/WEB-INF/classes/ cl.entel.wsautogestionmm.services.WSMMAutoGestionImpl -wsdl -inlineSchemas


Nota: debemos asegurarnos que tenemos todos los .Class que necesitamos en la ruta "/home/luxo/WSQPS_MM/build/web/WEB-INF/classes/" ya que si tenemos otros target Name Space le faltaran deficiones de objetos y dara un error como este:


luxo@luxo-Vostro-3460:~/WSQPS_MM/src/java$ sh /home/luxo/Descargas/WSDL/jaxws-ri/bin/wsgen.sh -verbose -keep -d /home/luxo/Descargas/WSDL/ -cp /home/luxo/WSQPS_MM/build/web/WEB-INF/classes/ cl.entel.wsautogestionmm.services.WSMMAutoGestionImpl -wsdl -inlineSchemas
Exception in thread "main" java.lang.NoClassDefFoundError: cl/allware/qps/service/pcrf/unified/types/SubscriberType
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)



Ubuntu Cambio de Hora [Chile]




El Ministerio de Energía anunció oficialmente cuándo debemos cambiarnos a la hora de invierno este 2014, fijando la fecha para el 26 de abril.
Ese día, debemos cambiar nuestro reloj a UTC-4, o en otras palabras, pasar de las 0:00 a las 23:00 del sábado. Por otro lado el horario de verano volverá el 7 de septiembre, día en el que habrá que operar a la inversa y correr el reloj a UTC-3.


Si tienes Ubuntu solo vasta con:


sudo apt-get upgrade
[sudo] password for XXXXX
 
 
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
Calculando la actualización... Listo
Los siguientes paquetes se han retenido:
  linux-generic linux-headers-generic linux-image-generic python-cupshelpers
  system-config-printer-gnome
Se actualizarán los siguientes paquetes:
  tzdata tzdata-java unzip
3 actualizados, 0 se instalarán, 0 para eliminar y 5 no actualizados.
Necesito descargar 398 kB de archivos.
Se liberarán 11.3 kB después de esta operación.
¿Desea continuar? [S/n] s
Des:1 http://cl.archive.ubuntu.com/ubuntu/ trusty-updates/main tzdata-java all 2015a-0ubuntu0.14.04 [69.7 kB]
Des:2 http://cl.archive.ubuntu.com/ubuntu/ trusty-updates/main tzdata all 2015a-0ubuntu0.14.04 [171 kB]
Des:3 http://cl.archive.ubuntu.com/ubuntu/ trusty-updates/main unzip amd64 6.0-9ubuntu1.2 [157 kB]
Descargados 398 kB en 2seg. (198 kB/s)
Preconfigurando paquetes ...
(Leyendo la base de datos ... 322135 ficheros o directorios instalados actualmente.)
Preparing to unpack .../tzdata-java_2015a-0ubuntu0.14.04_all.deb ...
Unpacking tzdata-java (2015a-0ubuntu0.14.04) over (2014i-0ubuntu0.14.04) ...
Preparing to unpack .../tzdata_2015a-0ubuntu0.14.04_all.deb ...
Unpacking tzdata (2015a-0ubuntu0.14.04) over (2014i-0ubuntu0.14.04) ...
Configurando tzdata (2015a-0ubuntu0.14.04) ...

Current default time zone: 'America/Santiago'
Local time is now:      mié feb  4 15:24:55 CLST 2015.
Universal Time is now:  Wed Feb  4 18:24:55 UTC 2015.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

(Leyendo la base de datos ... 322122 ficheros o directorios instalados actualmente.)
Preparing to unpack .../unzip_6.0-9ubuntu1.2_amd64.deb ...
Unpacking unzip (6.0-9ubuntu1.2) over (6.0-9ubuntu1.1) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Configurando tzdata-java (2015a-0ubuntu0.14.04) ...
Configurando unzip (6.0-9ubuntu1.2) ...
luxo@luxo-Vostro-3460:~$ sudo apt-get upgrade
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
Calculando la actualización... Listo
Los siguientes paquetes se han retenido:
  linux-generic linux-headers-generic linux-image-generic python-cupshelpers
  system-config-printer-gnome
0 actualizados, 0 se instalarán, 0 para eliminar y 5 no actualizados.

Problemas de activación WIFI6 en LG_OLED55CXPSA

  Mi experiencia con este TV  ah sido impecable hasta ahora, llevaba un uso normal y no tenia que usar la conexión por wifi ya que tengo una...