I am a computer programmer by profession. I have created many web services for clients such as transferring planning applications between local authorities and the government planning portal.
A web service is a bit like a web page in that it contains useful information that is delivered to the end user via the internet using web (http) protocols.
The difference between a web service and a web page is that the information from a web service is usually very dynamic (freshly calculated) and is very tailored to the requesters needs (the requester usually supplies a few parameters to the query to indicate his exact needs).
The immediate consumer of a web service is usually a computer program such as another web service and so the format of the information returned is usually very machine readable (e.g. xml, json, csv) rather than human readable (html).
To write a web service you can use a programming language such a Java, and package it as a servlet so that it can be plugged into a web application server such as JBoss.
There are many frameworks designed for supporting web services, e.g. Spring, J2EE, OSGi, Apache CXF and NetKernel. The frameworks often supply their own web server as well as adapters to plug into other frameworks (usually via a servlet).
We need to narrow down the choices.
Use a RESTful API for your service where the service name and parameters are mostly encoded inside the URL. This makes it easy to call from a simple web page while testing and permits caching. E.g. a url such as http://myhost/myservice/customer/15423/balance
If you just have one big service then a simple java servlet is the simplest choice. This will deploy anywhere and can use any helper APIs you know of.
If you have a variety of coordinated services that are interdependent then you need to consider dependency management, finding (resolving) services at runtime and hot deployment and inter-service call efficiency. All frameworks provide some support for this.
Netkernel goes the furthest in terms of designing for all scales and allows quite fine grained composition of micro-services with good control of scope and dynamic service resolution. It models itself similar to the web and unix so that new services can be added and evolved cheaply.
A static tutorial is here
http://docs.netkernel.org/book/view/book:tutorial:guide/doc:tutorial:selections:rest-web-services
I may create my own tutorial soon and I intend to deploy your web services with a web service so you wont need to install anything. I like to live dangerously.
No comments:
Post a Comment