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).
- Set Use Native Soap property to Yes.
- Download JAX-WS (http://jax-ws.java.net/2.2.8/)
- Copy the downloaded files to the lib directory of the webapp.
- 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
- Add the following jar files to the web application \lib folder:
- Set a value for Java package name property.
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.
When Use Native Soap property is set to Yes, some additional descriptors are copied to the WEB-INF directory.
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"/>
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.
The web services WSDL URL will be as follows: