Next the WSDL is put through the Axis2 tool to generate the server code. This server code contains logic to receive XML from the HTTP server using SOAP (which contains the input data), parse it, and create the types to pass to the main application. It also contains code to turn these types back to XML and return to the Web server, which returns a SOAP response.
You must start the JBoss EAP 7.1 server before generating the server-side code:
This opens the New Server dialog box.
To generate the server-side code:
A progress bar might appear while it generates the code.
Exception occurred during code generation for the WSDL : java.lang.NoClassDefFoundError:
This is because Eclipse does not copy the xmlschema-core-n.n.n.jar file to your dynamic Web project. To avoid this exception, copy the xmlschema-core-n.n.n.jar file located in your $AXIS2_HOME/lib folder to the DynWebTest1/WebContent/WEB-INF/lib folder. You need to restart Eclipse before attempting to run the server-side code generation steps again.
The classes BookDetails, BookReturn, BookReturnE, NewBook, and StockNo hold instances of the types represented in the WSDL.
In the outline view for BookLegacySkeleton.java are four methods, nextBook(), readBook(), deleteBook(), and addBook(). These are the methods that are called by the web service for the operations that were defined and is where you place your code.
Because you might want to regenerate this code, it is a good idea to keep the user code in this file to a minimum and have all the logic in a separate class. Each of these methods contain one line to invoke an appropriate method in a new class called BookOperation. The next step is to create this class which interfaces between the Web service and the COBOL application.