Use Native Soap support in Java

Official Content
This documentation is valid for:

Web services can be generated when using native JAVA support based on JAX-WS. This allows you to implement ws* (web service security, web service addressing, etc).

How to implement native soap support in GeneXus using Java

  1. Set Use Native Soap property to Yes.
  2. Download JAX-WS (http://jax-ws.java.net/2.2.8/)
  3. Copy the downloaded files to the lib directory of the webapp.

Requirements

  1. It is recommended that you use JDK 1.6 or higher.
    JDK / JRE 1.9 is supported as of GeneXus 15 upgrade 12.
    JVM 1.9 needs to be started with parameter "--add-modules java.xml.ws"
    In case of OpenJdk, it is recommended Version 11 or higher. In this case, Genexus Version V16 U8 or higher is required
  2. Add the following jar files to the web application \lib folder:
    • jaxws-rt.jar
    • jaxb-core.jar
    • streambuffer.jar
    • jaxb-impl.jar
    • policy.jar
    • stax-ex.jar
    • gmbal-api-only.jar
    • management-api.jar
    • ha-api.jar
  3. Set a value for Java package name property.

Details of the implementation

As usual, for each procedure with Call protocol property = SOAP (e.g: "mywebservice"), a source file named "amywebservice_impl.java" is generated containing the web service implementation.
In addition, when Use Native Soap property = Yes, a source file named amywebservice_services.java is generated. It declares the web service definition using annotations, as well as the parameters of the web service and its methods (at present, the only method is "Execute").

Under the Java model (under the jaxws directory) some classes are compiled and transferred to the jaxws directory under the webapp.

Generated Descriptors

When Use Native Soap property is set to Yes, some additional descriptors are copied to the WEB-INF directory.

  • sun-jaxws.xml. 
    It contains the definition of the web services.
    In the following example, the package name is com.webservices.test, and the sun-jaxws.xml is as follows:
<endpoint name="get Clientes" implementation="com.webservices.test.agetclientes_services" url-pattern="/servlet/ws/com.webservices.test.agetclientes_services"/>
  • web.xml. 
    It is automatically generated from the web*_native_ws.xml template under the web directory of the model and transferred to the WEB-INF directory.

Web service WSDL URI

The web services WSDL URL will be as follows:

http://server:port/<URL BASE>/servlet/ws/<package>.<servicename>_services?wsdl

Example:

http://172.16.3.3:8080/JavaEnvironment/servlet/ws/com.webservices.test.agetclientes_services?wsdl