Forum OpenACS Q&A: Re: SOAP Gateway Package ready

Collapse
Posted by Dan Wickstrom on
I was thinking of the case for server-to-server communication,  and for such a case, having the ablity to generate the client stubs would be a big win in simplifying the development process for soap-based services.

For example, I've been working on a news-feed package that  uses soap services to transfer news items from a news instance on one server to news instance on another server. Basically it is just a specialized service for copying CR items from one server to another.  To develop the soap service, I prototyped it using my web-services package (based on nsjava and apache-axis), and then when I was happy with the design, I converted the soap calls to tcl.  In the tcl implmentation, I store message templates with placeholders for interpolating the data necessary for creating the soap message, and then on the receiving end, I use ns_xml to parse the received messages. The soap messages are parsed by a specialized request processor that is hard-coded for the news-feed service.  The tcl implementation is lightweight and, other than the network, there is no perceptible delay.

Having your package would have saved me some work in writing the soap request processor, but I would still be left with quite a bit of work for creating the client stubs.  As you probably already know, the axis implementation allows you to write a java interface class and use a utility to generate a wsdl file.  Then, there also is another utility that takes the wsdl file as an input and generates all of the client stubs and server skeleton code based on the wsdl description.  So all a developer has to do, is write a java interface class, generate the wsdl, client stubs and server skeleton code, and the fill in the server skeleton implementation to create a web-service.

For your package, the approach seems to be to write the server implementation utilizing @Idl tags in the document section of ad_proc to describe the interface, and then using information from those tags you generate a wsdl description that soap toolkits can use to generate the client stubs.  Possibly tcl-based client stubs could be generated by tclsoap from the wsdl description?  Has anybody looked into this?

I'm thinking that the server-to-server type applications will proabaly be the most valuable, so if you can add support for generating client stubs and complex types, your  soap gateway package will become really useful for building openacs-based web services.

Collapse
Posted by William Byrne on
Support for the Tcl client stubs is an interesting one in terms of persistence and dynamic loading of the stubs. And, there's the cost of generating the stubs and who'll do the work and how often (client or server.) Certainly, the code implementation for stub generation is nothing more than an excercise. In light of your level of interest and the benefits you point out, I'll give the issue greater attention.

For now, if you're interested in the soap-gateway package, I recommend using whatever techniques you now employ to generate your stubs. Most likely, I'll provide another parameter in the WSDL fetch that allows a developer to specify stub generation. I've done this for C++ in another project and I can certainly do it for this one as well. The first blast would target the OpenACS/ns_xml/tcl combo. Upon fetching the WSDL generated code, you'd park it somewhere in your OpenACS code base. I'll extend the SG's source library management pages to include stub management.

Out of curiosity, what flavor of complex types do you require? Basic arrays, structures, arbitrary ranges within multi-dimensional arrays....

Ah, and there's still the issue of attachments...  what are your thoughts on the DIME spec?

Collapse
Posted by Dan Wickstrom on
Just being able to generate the stubs would be nice, but having Stub management would be a plus.

As far as complex types, I'm currently using arrays of structures (java beans), but I'm sure that having other complex types like multi-dimensional arrays and structures that contain nested structures would also be useful.

I haven't used attachments, other than to try a few attachment based demos, but I definitely think they would be worth having.

With regards to the use of tDom, using the xml abstraction procs in openacs would probably be the way to go for now, so you don't have to rewrite everything when openacs goes from ns_xml to tDom.

Collapse
Posted by William Byrne on
Funny you should mention XML abstraction. I almost created an abstraction in SG when I rolled back the ns_xml version from 1.5 to 1.4 a couple of days ago. So, there's a XML abstraction somewhere?

I'd be more than happy to use tDOM. I noticed it delivers namespace info which ns_xml didn't do very well.

I agree Bart would be a good person to contact since this entire SOAP Gateway package began with the need to connect to the ecommerce package.