SOAP - undefined handler subroutine

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
 
A

Anno Siegel

Aaron Couts said:
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:

The sub "handler" is missing from package SOAP::ServerDemo.

This defines a sub "handler" in package ServerDemo. You need one
in SPAP::ServerDemo.

Anno
 
A

Anno Siegel

Aaron Couts said:
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:

The sub "handler" is missing from package SOAP::ServerDemo.

This defines a sub "handler" in package ServerDemo. You need one
in SOAP::ServerDemo.

Anno
 
A

Aaron Couts

This defines a sub "handler" in package ServerDemo. You need one
in SOAP::ServerDemo.

Anno

It turns out this wasn't my only problem, but it put me on the right track.
Thanks for the response.
-Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top