POE::Component::Server::SOAP

Publish POE event handlers via SOAP over HTTP
Download

POE::Component::Server::SOAP Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Apocalypse
  • Publisher web site:
  • http://search.cpan.org/~apocal/

POE::Component::Server::SOAP Tags


POE::Component::Server::SOAP Description

Publish POE event handlers via SOAP over HTTP POE::Component::Server::SOAP is a Perl module that makes serving SOAP/1.1 requests a breeze in POE.The hardest thing to understand in this module is the SOAP Body. That's it!The standard way to use this module is to do this: use POE; use POE::Component::Server::SOAP; POE::Component::Server::SOAP->new( ... ); POE::Session->create( ... ); POE::Kernel->run();POE::Component::Server::SOAP is a bolt-on component that can publish event handlers via SOAP over HTTP. Currently, this module only supports SOAP/1.1 requests, work will be done in the future to support SOAP/1.2 requests. The HTTP server is done via POE::Component::Server::SimpleHTTP.SYNOPSIS use POE; use POE::Component::Server::SOAP; POE::Component::Server::SOAP->new( 'ALIAS' => 'MySOAP', 'ADDRESS' => 'localhost', 'PORT' => 32080, 'HOSTNAME' => 'MyHost.com', ); POE::Session->create( 'inline_states' => { '_start' => &setup_service, '_stop' => &shutdown_service, 'Sum_Things' => &do_sum, }, ); $poe_kernel->run; exit 0; sub setup_service { my $kernel = $_; $kernel->alias_set( 'MyServer' ); $kernel->post( 'MySOAP', 'ADDMETHOD', 'MyServer', 'Sum_Things' ); } sub shutdown_service { $_->post( 'MySOAP', 'DELMETHOD', 'MyServer', 'Sum_Things' ); } sub do_sum { my $response = $_; my $params = $response->soapbody; my $sum = 0; while (my ($field, $value) = each(%$params)) { $sum += $value; } # Fake an error if ( $sum < 100 ) { $_->post( 'MySOAP', 'FAULT', $response, 'Client.Add.Error', 'The sum must be above 100' ); } else { # Add the content $response->content( "Thanks. Sum is: $sum" ); $_->post( 'MySOAP', 'DONE', $response ); } } Requirements: · Perl


POE::Component::Server::SOAP Related Software