Pure English

 
Software
Training
Hints & links
 
Computing
Elettronics
Matemathics
Tai Ji Quan
Giada Adriani
 
Thesis
Notes
Reviews
 
Blister
Short stories
Novels
Guests
 
Games
Events
Work-e
Ma.Ste.R.
 
Links
Search
About me
Contacts
Site map
Bandiera inglese Bandiera italiana

Web Service Template

Template

Template web service is a web service implemented in Java for training purposes, but can also be used as a starting point to develop actual web services for Enterprise applications. Being a template should be theoretically possible to develop any web service by modifying or adding a small number of Java classes to this template, while maintaining the overall architecture of the web service.
The Template web service was developed using the following technologies:

  • Axis2 version 1.5.6
  • Apache Tomcat version 7.0.39
  • Eclipse Juno Service Release 2
  • Java SDK version 1.6.0_43

The Template web service is ready to handle connections to the Oracle, PostegreSQL and MySQL database and includes all the required drivers. To connect the web service to another database, you must:

1) Modifiy the class adriani.jws.template.db.Database
2) Include the required JDBC drivers into the lib directory of the deploy enviroment
3) Specify the custom connection string to the database in the configuration.properties file

The downloadable ZIP package containes:

  • All the required Java sources files necessary to compile the project
  • Ant build.xml file useful to build the web service
  • AAR version of the web service ready to be deployed
  • PDF manual explaining how to use the software (Italian)
  • PDF document describing the design of the software (Italian)
  • JAR libraries required to compile and run the project using Oracle, PostegreSQL, MySQL and Log4j
  • Scripts BATCH/Shell allowing to test the web service on a Windows/Linux terminal
  • Scripts SQL for creating and populating test data on a Oracle, PostegreSQL or MySQL database

Please read the design document (service_design_ita.pdf) before attempting to change the Java source or develop a new web service from the Template project. In particular it is crucial to understand how to customize the wrappers in the adriani.jws.template.wrappers package which shape the structure of the elements produced by the ADBBean plugin of the Eclipse WTP IDE or the wsdl2java tool. The aim of these wrappers is to convert the SOAP request in the Java objects used by the business logic and, conversely, to map the results of the business logic in the SOAP response. This mechanism grants the loose coupling between the web service logic and the WSDL structure.

The current version of Template web service provides following features:

  • Two dummy SOAP methods providing example of actual usage
  • Ant build file switching among three different environments (development, test, production)
  • Runnable using the Soapplication command line mode (SimpleClient)
  • Pool database connections management system (JDBCConnectionPool)
  • Capability to use a mocked pool for testing or debugging (MockConnectionPool)
  • Wrappers classes ensuring loose coupling (adriani.jws.template.wrappers)
  • Capability to configure the web service at run-time using simple SOAP messages (remote management)
  • Two alternative and complementary log systems (Log4j and SystemLogger)
  • Error messages internationalization depending by the local user's machine (ErrorMessage)
  • Collection of analysis and statistics data for performances evaluation (GeneralAnalyzer)
  • Capability to measure execution times for each single query (service.benchmark)
  • Management of the SOAP header allowing to fetch authentication data (optional)