17-07-2012, 04:41 PM
Implementing a simple web service
Implementing a simple web service.pdf (Size: 472.54 KB / Downloads: 402)
Introduction
In this activity you will see how to use Eclipse to create and test a very simple web
service. Before I look at the service itself, however, I shall provide some background
information about the different approaches that can be used to develop a web service.
Components of a web service
From an implementation point of view, a web service typically has two distinct
components:
· Some 'logic', which actually carries out the real work required to provide the
service functions, whatever they might be. For example, a simple service to
calculate VAT might include at its heart a piece of code that receives a monetary
value in sterling, such as £10, multiplies that value by 17.5% to calculate the VAT
(£1.75) and returns the new total value including VAT (£11.75).
· An interface, which is implemented in XML. This describes how to put a request to
the service and what the expected response or result may consist of.
In addition, in order to actually make use of any web service we implement, we need
also to implement a client that constructs our request (based on the XML interface)
and displays the result returned by the web service.
This view of a web service should help to explain the different approaches to
producing a web service.
Summary
In this activity you have been taken through the steps required to create, deploy (to an
application server on your local machine) and test a simple web service. This is a
significant step in understanding at first hand how SOA actually works. In subsequent
practical activities you will deploy your web service to a server on the Internet, publish
its description to a UDDI registry, test its level of interoperability and be able to access
and use it on the Internet.