Name : perl-POE-Component-Server-XMLRPC
| |
Version : 0.05
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 6.2
| Date : 2015-06-11 07:13:19
|
Group : Development/Libraries/Perl
| Source RPM : perl-POE-Component-Server-XMLRPC-0.05-6.2.src.rpm
|
Size : 0.01 MB
| |
Packager : (none)
| |
Summary : Publish POE event handlers via XMLRPC over HTTP
|
Description :
POE::Component::Server::XMLRPC is a bolt-on component that can publish a event handlers via XMLRPC over HTTP.
There are four steps to enabling your programs to support XMLRPC requests. First you must load the component. Then you must instantiate it. Each POE::Component::Server::XMLRPC instance requires an alias to accept messages with and a port to bind itself to. Finally, your program should posts a \"publish\" events to the server for each event handler it wishes to expose.
use POE::Component::Server::XMLRPC POE::Component::Server::XMLRPC->new( alias => \"xmlrpc\", port => 32080 ); $kernel->post( xmlrpc => publish => session_alias => \"methodName\" );
Later you can make events private again.
$kernel->post( xmlrpc => rescind => session_alias => \"methodName\" );
Finally you must write the XMLRPC request handler. XMLRPC handlers receive a single parameter, ARG0, which contains a XMLRPC transaction object. The object has two methods: params(), which returns a reference to the XMLRPC parameters; and return(), which returns its parameters to the client as a XMLRPC response.
sum_things => sub { my $transaction = $_[ARG0]; my $params = $transaction->params(); my $sum = 0; while (AATT{$params}) $sum += $value; } $transaction->return(\"Thanks. Sum is: $sum\"); }
And here is a sample XMLRPC::Lite client. It should work with the server in the SYNOPSIS.
use warnings; use strict;
use XMLRPC::Lite;
print XMLRPC::Lite -> proxy(\'http://poe.dynodns.net:32080/?session=sum_server\') -> sum_things(8,6,7,5,3,0,9) -> result ; pring \"\ \";
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-P/openSUSE_Tumbleweed/noarch |