Unfortunately, this principle is often lost when it comes to the implementations of SOA services. All too often we see a big implementation class with multiple concerns such as security, transaction management, and logging all mixed in with the business logic. Using the Aspect Oriented Programming (AOP), we can drive the separation of concerns down into the implementation of services.
In this article, we show how to develop a Web service using Apache Axis and Spring, and secure it with Acegi Security--all while keeping the concerns nicely separated.
Motivation and Design
The example we will use in this article is a service called FundsTransferService, which a bank might use to transfer funds from one account into another. The WSDL for this service is available along with all the source code, configuration files, and build file in the Resources section of this article. We've deliberately kept this service very simple so that we can focus on the more relevant aspects of the article.