A
Aaron Couts
I had SOAP working last night and now it's mysteriously not working. I'm
trying to get a test script going with SOAP::Lite, Apache, and mod_perl.
Whenever I call my routine, I Apache gives me:
-------------
[Tue Aug 3 19:29:24 2004] [error] Undefined subroutine
&SOAP::ServerDemo::handler called.
-------------
Here's my ServerDemo.pm (straight from the SOAP::Transport::HTTP::Apache doc):
-------------
package ServerDemo;
use SOAP::Transport::HTTP::Apache;
sub handler {
my $safe_classes = {
Calculator => undef,
};
SOAP::Transport::HTTP::Apache->handler($safe_classes);
}
package Calculator;
sub new {
bless {}, shift;
}
sub handle_request {
my ($self, $headers, $body, $envelopeMaker) = @_;
$body->{extra_stuff} = "heres some extra stuff";
foreach my $header (@$headers) {
$header->{extra_stuff} = "heres some more extra stuff";
$envelopeMaker->add_header(undef, undef, 0, 0, $header);
}
$envelopeMaker->set_body(undef, 'myresponse', 0, $body);
}
1;
-------------
Here's my client:
-------------
#!/usr/bin/perl
use SOAP::Lite;
print SOAP::Lite
-> uri('http://10.0.131.98/Calculator')
-> proxy('http://10.0.131.98/soap')
-> handle_request
-> result;
-------------
And here's my Apache config (i've already verified that mod_perl is working):
-------------
<IfModule mod_perl.c>
<Location /soap>
SetHandler perl-script
PerlHandler SOAP::ServerDemo
</Location>
</IfModule>
-------------
I've tried this several different ways, and I always get a message that
the handler subroutine isn't defined, even though I can see it right there
in ServerDemo.pm. Last night I got Paul Kulchenko's farenheit-celcius
converter working with a very similar client, but then I made a change and
it stopped working. Any help would be greatly appreciated.
Thanks,
Aaron Couts
trying to get a test script going with SOAP::Lite, Apache, and mod_perl.
Whenever I call my routine, I Apache gives me:
-------------
[Tue Aug 3 19:29:24 2004] [error] Undefined subroutine
&SOAP::ServerDemo::handler called.
-------------
Here's my ServerDemo.pm (straight from the SOAP::Transport::HTTP::Apache doc):
-------------
package ServerDemo;
use SOAP::Transport::HTTP::Apache;
sub handler {
my $safe_classes = {
Calculator => undef,
};
SOAP::Transport::HTTP::Apache->handler($safe_classes);
}
package Calculator;
sub new {
bless {}, shift;
}
sub handle_request {
my ($self, $headers, $body, $envelopeMaker) = @_;
$body->{extra_stuff} = "heres some extra stuff";
foreach my $header (@$headers) {
$header->{extra_stuff} = "heres some more extra stuff";
$envelopeMaker->add_header(undef, undef, 0, 0, $header);
}
$envelopeMaker->set_body(undef, 'myresponse', 0, $body);
}
1;
-------------
Here's my client:
-------------
#!/usr/bin/perl
use SOAP::Lite;
print SOAP::Lite
-> uri('http://10.0.131.98/Calculator')
-> proxy('http://10.0.131.98/soap')
-> handle_request
-> result;
-------------
And here's my Apache config (i've already verified that mod_perl is working):
-------------
<IfModule mod_perl.c>
<Location /soap>
SetHandler perl-script
PerlHandler SOAP::ServerDemo
</Location>
</IfModule>
-------------
I've tried this several different ways, and I always get a message that
the handler subroutine isn't defined, even though I can see it right there
in ServerDemo.pm. Last night I got Paul Kulchenko's farenheit-celcius
converter working with a very similar client, but then I made a change and
it stopped working. Any help would be greatly appreciated.
Thanks,
Aaron Couts