Forum OpenACS Q&A: OpenACS and Web Services

Posted by Caroline Meeks on
As part of the proposals and marketing pieces I am working on I'd like to present OpenACS's current web services functionality as well as our potential.

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.

Posted by Bart Teeuwisse on

it is me who modified bookshelf to use Amazon's XML RPC based web service. You can see it in action on

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.


Posted by Claudio Pasolini on
I created several web services using the excellent soap-gateway package made by William Byrne (thank you William! Why don't you upload your package in contrib?).

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)
If you want to give it a try use as user and demo as password. To get to the web services follow the link 'Imposta Comunale sugli Immobili'.
Posted by Jorge Garcia on
Claudio, any sample code will be welcomed.



Posted by Claudio Pasolini on
Here are some more details about the portal I made using the soap-gateway package:
  • 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
    1. perform several queries about their fiscal declarations and payments
    2. calculate the amount due for a given fiscal year with regard to their real estate properties
    3. submit their fiscal declarations and (in the next release) pay the amount due
The portal is made up with two packages.
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
  • modify the way the WSDL are automatically built
The lesson learned is that it works and can provide a powerful way to bring any legacy code to the web with all the advantages of OpenACS, the only problem being the availability of legacy db drivers within Aolserver. Hope this helps
Posted by Jorge Garcia on
Thanks for the code, Claudio.

I will study it with close attention.

A really interesting project.

Just curious: Which the 'piece of code originally written by Philg' you mention?


Posted by Claudio Pasolini on
To build the lacking soap client I started from this old but very interesting article of Philg.
Posted by Caroline Meeks on
As promised above I uploaded the technical sections of the grant proposal to file storage. Hopefully our marketing material can be like our code and the next person who uses it can improve it and upload another version.