SOAP - undefined handler subroutine

Discussion in 'Perl Misc' started by Aaron Couts, Aug 4, 2004.

  1. Aaron Couts

    Aaron Couts Guest

    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

    --
    To contact me via email, substitute
    'aaronc' for 'spam' in my address.
    http://www.towerdata.com
     
    Aaron Couts, Aug 4, 2004
    #1
    1. Advertising

  2. Aaron Couts

    Anno Siegel Guest

    Aaron Couts <> wrote in comp.lang.perl.misc:
    > 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.


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

    > -------------
    > Here's my ServerDemo.pm (straight from the SOAP::Transport::HTTP::Apache doc):
    > -------------
    > package ServerDemo;
    > use SOAP::Transport::HTTP::Apache;
    > sub handler {


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

    Anno
     
    Anno Siegel, Aug 4, 2004
    #2
    1. Advertising

  3. Aaron Couts

    Anno Siegel Guest

    Aaron Couts <> wrote in comp.lang.perl.misc:
    > 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.


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

    > -------------
    > Here's my ServerDemo.pm (straight from the SOAP::Transport::HTTP::Apache doc):
    > -------------
    > package ServerDemo;
    > use SOAP::Transport::HTTP::Apache;
    > sub handler {


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

    Anno
     
    Anno Siegel, Aug 4, 2004
    #3
  4. Aaron Couts

    Aaron Couts Guest

    In article <ceq7m4$fhf$-Berlin.DE>, Anno Siegel wrote:
    > 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

    --
    To contact me via email, substitute
    'aaronc' for 'spam' in my address.
    http://www.towerdata.com
     
    Aaron Couts, Aug 5, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    0
    Views:
    486
  2. Replies:
    4
    Views:
    184
    Bob Walton
    Aug 12, 2003
  3. Torsten Mangner

    testing for 'undefined subroutine'

    Torsten Mangner, Nov 4, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    144
    Bob Walton
    Nov 5, 2003
  4. Moulin Kluge
    Replies:
    2
    Views:
    342
    pkent
    Jan 27, 2004
  5. king
    Replies:
    5
    Views:
    188
Loading...

Share This Page