Forum OpenACS Q&A: OpenACS and Web Services
Can people catch me up on what they have been doing with web services. I saw a post from Dan W on a package back in Nov 2002. Also I remember that someone made the bookshelf package work with amazon's web services.
I'd love updates on either of those project and anyone else who has implemented anything consuming or suppling a web service.
PS When I am done with the two grant proposals I am doing I will take out the client specific portions and post the "Why OpenACS" pieces in file storage so we can start to build a repository of marketing material.
it is me who modified bookshelf to use Amazon's XML RPC based web service. You can see it in action on http://www.thecodemill.biz.
I haven't contributed the modification back into the toolkit as I would prefer a more general solution instead of this one off hack. Also the current bookshelf package doesn't scale very well when integrated with Amazon's web service. The index page of bookshelf shows all books on the shelf and requests additional information from amazon for each book. With more than a handfull of books (and depending on the Internet connection with Amazon) this results in a server time out the first time you request the page. Because results are cached subsequent requests for the index page typically do work. The point is that bookshelf requires some reworking to avoid this problem.
I've also looked investigated adding tDOM support in TclSoap. It is certainly feasable but the maintainer of TclSoap never responded to my offer to help.
Currently I'm not actively developing web services although the need for SOAP and XML RPC capabilities is likely to occur at my work in the forseable future. At which point I'll revisit these topics.
The soap-gateway package makes the creation and publishing of web services very easy. The package provides also a small number of examples and a way to invoke them via an AXIS client, but you'll have to write your own procs if you want to invoke a web service from Aolserver (I could provide a working example).
The soap-gateway package internally uses ns_xml, but I suggest, and in fact I did so, that you use tdom as the preferred xml parser in your tcl scripts.
The project I made is already viewable even if not yet released in production and will provide both informational and interactive services about fiscality to the citizens of Mantova.
It consists of two layers:
- the first talks to a remote PostgreSQL database and exposes his services via soap-gateway
- the second manages the presentation and talks via XML/SOAP with the first layer (it uses tDOM as XML parser)
- My client is the "City of Mantova" (the local government authority of the city of Mantova)
- The portal will provide services about all the local taxes managed by the "City of Mantova", the main of wich being the "Imposta Comunale sugli Immobili (ICI)" (i.e. a tax on real estate property)
- Registered users will be able to
- perform several queries about their fiscal declarations and payments
- calculate the amount due for a given fiscal year with regard to their real estate properties
- submit their fiscal declarations and (in the next release) pay the amount due
The first (soap-gateway augmented with the procs implementing the web services) talks to a back-end server (OpenACS 3.4 + PostgreSQL) used by the "City of Mantova" in his intranet to manage local taxes. AFAIK Postgresql is not able to generate directly XML and so I've used tDOM to create XML from the result sets.
The second package interacts with the soap-gateway via XML/SOAP and manages the presentation of the services.
The presentation layer stores (if necessary) in the file system the XML received in order to minimize the interactions with the back-end and uses tDOM to parse the XML
I've not yet tested the system under heavy load, but the performances seems very good
The soap-gateway installed without any problem on my OpenACS 4.6, but I had to:
- create a soap client proc hacking a piece of code originally written by Philg (I've uploaded the soap client procs plus some wrapper procs around tDOM in openacs.org/storage/miscellaneous)
- modify the way the WSDL are automatically built
I will study it with close attention.
A really interesting project.
Just curious: Which the 'piece of code originally written by Philg' you mention?