--- nfo/perl/libs/OEF/Component/WebService/RpcXml.pm 2003/03/27 15:41:27 1.1 +++ nfo/perl/libs/OEF/Component/WebService/RpcXml.pm 2003/04/04 17:28:15 1.2 @@ -1,13 +1,14 @@ -#!/usr/bin/perl - -## -------------------------------------------------------------------------------- -## $Id: RpcXml.pm,v 1.1 2003/03/27 15:41:27 joko Exp $ -## -------------------------------------------------------------------------------- +## ------------------------------------------------------------------------ +## $Id: RpcXml.pm,v 1.2 2003/04/04 17:28:15 joko Exp $ +## ------------------------------------------------------------------------ ## $Log: RpcXml.pm,v $ +## Revision 1.2 2003/04/04 17:28:15 joko +## starting the *session* server/service from here +## ## Revision 1.1 2003/03/27 15:41:27 joko ## initial commit, code from daemon-api-admin.pl ## -## -------------------------------------------------------------------------------- +## ------------------------------------------------------------------------ package OEF::Component::WebService; @@ -20,25 +21,36 @@ use Data::Dumper; use RPC::XML; -use RPC::XML::Server; +use RPC::XML::SessionServer; use RPC::XML::Procedure; +# this is a global counter for giving unnamed webservices a unique id +our $instance_counter; + + sub start { my $self = shift; # notice - print "Starting WebService listening on port $self->{port}, using main API from Package $self->{api_module}.", "\n"; + print "Starting WebService listening on port $self->{ws_port}, using main API from Package $self->{api_module}.", "\n"; # trace #print Dumper($self); #exit; + $instance_counter++; + # here goes the server instance - $self->{_daemon} = RPC::XML::Server->new( - port => $self->{port}, - #path => 'RPCSERV', + $self->{_daemon} = RPC::XML::SessionServer->new( + port => $self->{ws_port}, + path => $self->{ws_path} || 'WebService' . $instance_counter, auto_updates => 1, + authentication => { + type => 'plain', + user => 'hello', + pass => '123', + } ); # API