[Techtalk] Open source SOAP/REST servers

Daniel Pittman daniel at rimspace.net
Tue May 12 01:08:39 UTC 2009


Kelly Jones <kelly.terry.jones at gmail.com> writes:

> I probably should've said SOAP, since that's what I'm focusing on.
> If I understand correctly, SOAP lets you make a function call across
> the web. In other words, instead of saying:

It does, yes, but...  Actually, there are quite a lot of "but" points in
SOAP, especially the cross-language bindings, as I discovered working
with a set of SOAP based solutions for some years.

> f(x1,x2,x3,x4,x5,...)
> where f is defined in some local library, you say:
>
> http://some.path/foo.xml with POST variables that effectively call f
> on the arguments x1,x2,x3,x4,x5,etc.

That isn't all that close to the truth; the way SOAP works is that it
defines an XML binding for RPC, and a standard for transporting that RPC
over various mechanisms including HTTP POST.

So, you will have less trouble thinking of SOAP as another RPC mechanism
like CORBA than you will thinking of it as "POST++".

> Of course, x1 may be an integer, x2 may be a list, x3 may be a hash,
> x4 may be an object, and x5 may be another function. In other words,
> f's arguments need not be "simple".

*nod*  Most of SOAP is about encoding those things, and the related
standards about communicating their formatting in a language-independent
way.

If only the designers had stuck with a tested solution WSDL wouldn't be
so awful, but that is a rant for another day.

> I want a SOAP server that does this for me:
>  % Listens for SOAP requests.
>  % When it gets one, demangles the XML to create a simple Perl (or
>    Ruby) function call.
>  % Takes the function's return value and wraps it in SOAP-like XML.
>  % Returns the wrapped value to the caller.

OK.  Use SOAP::Lite, which ships with examples of implementing that
using a range of bindings including CGI and FastCGI.  That certainly
meets your needs.

You could certainly wire up SOAP::Lite to HTTP::Server::Simple without
any great trouble, which would give you the lightest weight solution
that I can think of off the top of my head.

(Well, or bind SOAP::Lite to a raw TCP socket and use that from your
 client code. :)

[...]

> I want something that does the "reverse": converts a SOAP XML request
> into a function.

I don't know of the Ruby equivalent, but Python has ZSI and SOAPLib,
both of which are at about the same level as the Perl module: they do
all the hard work, but you have to plumb them to the outside world in an
application specific fashion.

I think you will find most of the solutions run at that level, because
there are a lot of common transports for SOAP and most developers of
SOAP servers don't want to be restricted to just one.


Finally, if you are working cross-language you will probably find that
the SOAP bindings have something of an impedance mismatch in the way
they represent the various data bindings for non-trivial structures.

Certainly, we spent a *lot* of time trying to get PHP and Perl to play
nicely in that regard, as the former loathed passing arrays as values.

Regards,
        Daniel


More information about the Techtalk mailing list