Java Reference
In-Depth Information
When the Server program runs, it calls the startHelloWorld method to create a WS
implementation that ties with a unique URL. The endpoint is then published and ready for
receiving requests from a remote client. For this simple program, Ctrl-C can be used to stop
the server.
The DbConfig.java class is a simple placeholder for the required parameters for database
access and for the URL. In a later example, Java code is used to implement data access
to the database. Remember, though, that this is sample code; therefore, the password is
displayed or stored in the clear. In a business or secure environment, passwords are entered
each time or stored encrypted.
1.5 Host a Web Service
In Eclipse IDE, perform the following actions:
1.
To run, open Server.java class. Choose Run Run As Java
Application. An Eclipse project would look like this: