r23761 - in /scripts/KGB: client/test server/test

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Mon Aug 4 17:21:46 UTC 2008


Author: dmn
Date: Mon Aug  4 17:21:43 2008
New Revision: 23761

URL: http://svn.debian.org/wsvn/?sc=1&rev=23761
Log:
add test server and client

demonstrates PoCo-SOAP problem of inability to return
anything to the client :(

Added:
    scripts/KGB/client/test   (with props)
    scripts/KGB/server/test   (with props)

Added: scripts/KGB/client/test
URL: http://svn.debian.org/wsvn/scripts/KGB/client/test?rev=23761&op=file
==============================================================================
--- scripts/KGB/client/test (added)
+++ scripts/KGB/client/test Mon Aug  4 17:21:43 2008
@@ -1,0 +1,19 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+use utf8;
+
+use SOAP::Lite;
+
+my $s=SOAP::Lite->new(
+    uri=>"http://localhost:12700",
+    proxy=>"http://localhost:12700?session=Test",
+);
+
+my $som = $s->commit();
+
+die 'SOAP FAULT: ', $som->fault->{faultstring}, "\n", $som->fault->{detail}, "\n"
+    if $som->fault;
+
+print $som;

Propchange: scripts/KGB/client/test
------------------------------------------------------------------------------
    svn:executable = *

Added: scripts/KGB/server/test
URL: http://svn.debian.org/wsvn/scripts/KGB/server/test?rev=23761&op=file
==============================================================================
--- scripts/KGB/server/test (added)
+++ scripts/KGB/server/test Mon Aug  4 17:21:43 2008
@@ -1,0 +1,60 @@
+#!/usr/bin/perl
+use utf8;
+use strict;
+use warnings;
+
+use POE;
+BEGIN {
+    package POE::Component::Server::SOAP;
+    use constant DEBUG=>2;
+}
+use POE::Component::Server::SOAP;
+
+my $my_name = 'Test';
+
+POE::Component::Server::SOAP->new(
+    ALIAS   => "$my_name-SOAP",
+    ADDRESS => '127.0.0.1',
+    PORT    => 12700,
+    HOSTNAME => 'localhost',
+);
+
+POE::Session->create(
+    inline_states => {
+        _start          => \&setup_service,
+        _stop           => \&shutdown_service,
+        soap_commit     => \&do_commit,
+    },
+#    options=>{trace=>1,debug=>1},
+);
+
+POE::Kernel->run;
+exit 0;
+
+sub setup_service {
+    my $kernel = $_[KERNEL];
+
+    $kernel->alias_set($my_name) == 0
+    	or die "Can't register alias Test\n";
+    $kernel->post("$my_name-SOAP" => 'ADDMETHOD',
+        $my_name => 'soap_commit',
+        $my_name => 'commit',
+    );
+
+    undef;
+}
+sub shutdown_service {
+    my $kernel = $_[KERNEL];
+    my $session = $_[SESSION]->ID();
+    warn "_stop \@session $session\n";
+    $kernel->post(SOAP => 'DELSERVICE', $my_name);
+}
+sub do_commit {
+    my $kernel = $_[KERNEL];
+    my $response = $_[ARG0];
+    $response->content('OK');
+    $kernel->post($_[SENDER] => 'DONE', $response );
+    return;
+    $kernel->post($_[SENDER], 'FAULT', $response, $SOAP::Constants::FAULT_CLIENT, 'Bad request', 'commit not implemented');
+    return 1;
+}

Propchange: scripts/KGB/server/test
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-perl-cvs-commits mailing list