How to use SOAP::Transport::HTTP::Plack

I needed to port a little cgi-script that implements a simple SOAP-server to Plack. After a little searching, I came across SOAP::Transport::HTTP::Plack.

Unfortunately, the documentation of this module is ... not really helpful.

Here's my (slightly modified) cgi-script:


use SOAP::Transport::HTTP;


Simple enough.

After some help of the awesome hobbs on IRC, here's part of my Plack psgi file:

use Plack::Builder;
use Plack::Request;
use SOAP::Transport::HTTP::Plack;

my $soap = SOAP::Transport::HTTP::Plack->new;

my $soap_app = sub {
    my $env = shift;

    return $soap
            )->handler( Plack::Request->new( $env ) );

return builder {
        '/soap_test' => $soap_app;

And low and behold, it works!


OK, those hobbs on IRC were "awesome".
And the only description of the module itself is "isn't really helpful".
I dare say it's unfair.

The best way to handle this is to provide a doc patch for the module to help anyone else who tries to use it. Then the module's documentation becomes awesome too. :D

Leave a comment

About confuseAcat

user-pic Random observations that may in some way be related to Perl.