Tutorial: Generate a Java wrapper for the "Employees" file
Java wrapper/stub classes are generated using the Apache Axis2 feature WSDL2Java.
If you do not have it already, download and install the latest Axis2 kit.
These are the steps required to generate the Java wrapper classes for the "adabas_EmployeesMini" DataView supplied with Portus:
Right-click the "JavaEmployees" project folder, select "Build Path", then "Add External Archives..:"
Add all .jar files from the axis2 "lib" directory to the project's Build-Path.
Open a command prompt (aka "DOS box"), change to the "JavaEmployees\src" directory and run the following command
wsdl2java -uri http://<yourserver>:<yourport>/adabas_EmployeesMini?WSDL -o ..\ -p SoaG
The following items are generated from a Portus WSDL:
Add a new Java class named "Tut_02_List" to the project ( File -> New -> Class ), opt to create a "main" method, click "Finish".
Run the program as a "Java Application"
The output appears in the "Console" window:
This sample selects all "Employees" records with a personnel-id of 50005nnn, you may want to experiment varying the key data, this is easily done by modifying the properties passed to the generated classes. E.g. try the following to list all records for "Employees" whose names start "SMI", living in cities with names starting "D".
keys.setPersonnel_id(""); keys.setName("SMI*"); keys.setCity("D*");
The following Java/Axis2 tutorial programs are available:
Tutorial | What it does |
---|---|
Tut_01a_Get.java | GET a single record by Personnel Id |
Tut_01b_GetByISN.java | GET a single record by ISN |
Tut_02_List.java | LIST some records |
Tut_03a_SelectSimple.java | SELECT by a range of Personnel IDs |
Tut_03b_SelectSorted.java | SELECT by a range of Personnel IDs and sort by Name |
Tut_03c_SelectConversational.java | SELECT by multiple ranges of Personnel IDs, returned in "chunks" of 20 records each |
Tut_04a_AddUpdateDelete.java | ADD + UPDATE + DELETE in "autocommit" mode |
Tut_04b_AddTransactional.java | ADD in a transactional context |
![]() ![]() |
![]() |
![]() ![]() |