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, Generator or Object property to Yes.
- 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"
For OpenJdk, it is recommended to use Version 11 or higher. In this case, GeneXus Version V16 U8 or higher is required.
- 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 the Use Native SOAP property is set to Yes, some additional descriptors are copied to the WEB-INF directory.
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.
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