Friday, February 04, 2005

StrutsWS (Web Service)

StrutsWS is a relativley new open-source project on Sourceforge http://sourceforge.net/projects/strutsws/. Frank Zametti, the author, has mentioned it various times recently on the struts user list. He mentioned today that he had just released a new MAJOR update, so I decided to take a look.

Here is Frank's abstract of the project:

This project is an attempt to create a mechanism in Struts whereby existing business logic components of a Struts-based application can be exposed as rudimentary Web Services without the need to change any code. To do this, I have created a custom RequestProcessor class. This class recognizes a Web Service request, that is, a SOAP message over HTTP, performs some pre-processing on the request, and passes it along to the targeted Action in a form it will understand. It then generates a SOAP-based XML response to the request in place of the usual view components of the existing application.

I read through the overview document and it sounded like an interesting project. It's main strength, in my opinion, is that you can use your existing Actions and ActionForms. There is no need to rewrite business objects to make them web services. Unfortunately, if an application makes heavy use of Session data, like session-scoped ActionForms or for handling security, then the StrutsWS library is of little value, since you now cannot use existing Actions and ActionForms. To quote Frank, "And of course, anything requiring session will NOT work, since no session would exist for a one-off request like these. "

I need to investigate Apache Axis a bit more and see how complicated it is use install and use.

No comments: