I Web service specifications

Wikipedia definition

A Web Service is defined by the W3C as "a software system designed to support interoperable machine-to-machine interaction over a network". Web services are frequently just Web APIs that can be accessed over a network, such as the Internet, and executed on a remote system hosting the requested services.

- Wikipedia

Webservice illustration
Webservice illustration - Wikipedia

In a web service, the Service Requester is able to call a function (the service) provided by the service provider somewhere over a network. To allow service requester to call it's services, the service provider published a web service definition - WSDL (Web service Definition Language) file. This file specify all the information needed by a service requester to call the service provider's services.

Required tools

We are now going to see how to build, deploy and test a end to end web service using Axis, Eclipse and Tomcat. In order to build and run the example, you need to install the following pieces of software :

Service specifications

This tutorial use our recurrent example. We will see how to make our CDService Java interface available through web services and how to invoke it. More specifically, we are going to expose the getById method only of our CDService interface.

The Dao implementation we are going to use is a very simple one. It use a Hashtable<Long,CD> as catalog and contains only one CD . Our Service implementation instantiate a Dao object to perform it's getById method.

CDDaoAxisImpl.java
CDServiceAxisImpl.java

Download the CDDaoAxisImpl.java CDDao implementation
Download the CDServiceAxisImpl.java CDService implementation