Loading ...
Sorry, an error occurred while loading the content.

185Re: [soaplite] Access to modules

Expand Messages
  • Brutsch, Michael
    Apr 10, 2001
    • 0 Attachment
      Hi Paul!

      > restriction. Probably the most convenient way for you is to use
      > ->dispatch_to('Class::[\w:]+');
      >
      > It should allow you to load all classes that have Class:: in their
      > name (but not Class itself). Any regular expressions are allowed, so

      I'm trying to use the regex-enabled static dispatch. Here are my files, and their locations:

      My module is in
      /opt/camelot/lib/PDS/MGT/DEMO/Demo.pm
      and looks like
      ----------------
      package Demo;
      sub hi { my ($self, $name) = @_; return "hello, $name\n"; }
      sub bye { my ($self, $name) = @_; return "goodbye, cruel $name\n"; }
      1;
      ----------------
      My server:
      ----------------
      use SOAP::Transport::HTTP;
      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => 12000)
      -> dispatch_to('PDS::[\w:]+');
      $daemon->handle;
      -----------------
      and my client:
      -----------------
      use SOAP::Lite;

      my $soap = SOAP::Lite
      -> uri('PDS/MGT/DEMO/Demo')
      -> proxy('http://localhost:12001')
      -> hi('test');
      print $soap->fault ? $soap->faultdetail."\n" : $soap->result;
      ------------------
      What I get, when I run the client, is
      ------------------
      bash$ perl soap_client.pl
      Failed to access class (PDS::MGT::DEMO::Demo): Can't locate PDS/MGT/DEMO/Demo.pm in @INC (@INC contains: PDS::[\w:]+) at (eval 16) line 3.

      Where do I specify the '/opt/camelot/lib' that my module tree lives in?
    • Show all 4 messages in this topic