
Hi,
I'm just doing my first steps in trying to communicate with OTRS through
RPC/SOAP.
I've created this short script for testing, which is derived from the rpc-
example.pl distributed by OTRS (2.2.6).
#####################
#!/usr/bin/perl -w
use Data::Dumper;
#config
use SOAP::Lite('autodispatch', proxy => 'http://myhost:4880/otrs/rpc.pl');
my $User = 'foo';
my $Password = 'bar';
my $RPC = Core->new();
print "NOTICE: TicketObject->TicketGet(TicketID => 2008052025000017)\n";
my %Ticket = $RPC->Dispatch($User, $Password, 'TicketObject', 'TicketGet',
TicketID => 2008052025000017);
print "NOTICE: Ticket Number is: $Ticket{TicketNumber} \n";
print Dumper \%Ticket;
#####################
The result when running this script on the client is:
./test-rpc.pl
NOTICE: TicketObject->TicketGet(TicketID => 2008052025000017)
Use of uninitialized value in concatenation (.) or string at ./test-rpc.pl
line 14.
NOTICE: Ticket Number is:
$VAR1 = {};
The server reports this in Apache's error.log:
[Thu Aug 28 18:49:18 2008] rpc.pl: Variable "%CommonObject" will not stay
shared at /var/www/localhost/otrs-2.2.6/bin/cgi-bin/rpc.pl line 81.
A user in #perlde (irc.perl.org) this is caused by using ModPerl::Registry
which I can confirm. My Apache2 config looks like this:
#####################
<IfModule mod_perl.c>
Perlrequire /var/www/localhost/otrs-2.2.6/scripts/apache2-perl-startup.pl
PerlModule Apache2::Reload
PerlInitHandler Apache2::Reload
PerlModule Apache2::RequestRec