Friday, January 23, 2009

Web Services & Spring Web Services Framework

Web Service Development Styles

When developing web services, there are two development styles, Contract Last(CL) and Contract First(CF). In first approach, development starts with coding and ends with WSDL (Web Service Description Language) generation from that. This approach is preffered when you have already implement your services. But in latter one, the WSDL contract is the starting point of development. Then continues with coding according to generated contract. This style widely preffered if services are not implemented yet.

Spring Web Services framework is only supports the CF style development. The SWS reference explains the reasons for this.

Loose Coupling

SWS is also reduces the coupling between the WSDL and implementation. Instead of programs tying implemantion classes with WSDL,like wsdl2java, SWS handles requests by implemented Endpoint classes. Mapping of arrived messages and Endpoint classes is up to you. For this behaviour, SWS supplies related classes which maps messages to endpoints according to their content or SOAP headers. The main idea is mapping is done according to XML messages not by message calls.

Method of Working

The execution of SWS can be depicted as the following figure.


Request is taken by dispatcher servlet named in figure as Message Dispatcher Servlet. Endpoint mapping concrete classes maps the arrived request to the related endpoint bean. Mapping is done by looking at SOAP Action Headers (SoapActionEndpointMapping) or by looking at the qualified name of the request payload root element (PayloadRootQNameEndpointMapping).

At web service layer, required parts is taken from request and passed to business layer to do some business jobs. Moreover, after the execution of business job(s), response message is also prepared at this layer.

Comming Soon
  1. Server Side Configuration
  2. Client Side Configuration
  3. Securing our Web Services
  • Authentication
  • Acegi Integration
  • Digital Signatures
  • Encryption/Decryption
  • Timestamps

No comments: