Related link: http://use.perl.org/~geoff/journal/9844
SOAP::Lite makes web services amazingly easy in Perl. They’re so easy, in fact, that you can focus on just getting your job done instead of thinking “Hey, I’m writing a web service.” That’s kind of Perlish.
I once worked a project with a wxPython frontend communicating with a Perl backend. My initial tests were wonderful, going from Perl to Perl through SOAP::Lite. As Geoff points out, this idiom Just Works:
use SOAP::Lite +autodispatch => uri => 'http://my.server.com/My/Class', proxy => 'http://my.server.com/soap'; my $o = My::Class->new('bar'); print $o->method('drink');
For the non-Perlers in the audience and the terminally lazy, this means to use SOAP::Lite, autodispatching unfound methods in the My::Class class to the remote server. It creates a new object of My::Class with the
new() call, then calls
method() on it. Very handy.
Of course, neither of the two SOAP toolkits the Python programmer could use supported this. To be fair, I’m not entirely certain it’s part of the SOAP spec. Of course, we dumped the raw XML from both types of requests (Perl <-> Perl and Perl <-> Python), compared it, and could find no discernable difference.
We ended up passing a session token around as the first argument of all method calls. This was very easy to support with my authentication proxy approach.
Still, I agree with Geoff. There must be an easy way to accomplish this in Java or Python, mustn’t there?
Have a solution? We’re all ears.