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

186Re: [soaplite] Access to modules

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

      > Where do I specify the '/opt/camelot/lib' that my module tree lives
      > in?

      you may specify it as you usually do with lib pragma in server code:

      > use SOAP::Transport::HTTP;
      use lib '/opt/camelot/lib';

      or combine static and dynamic approach in dispatch_to (all
      directories will be added to @INC during static dispatch):

      -> dispatch_to('/opt/camelot/lib', 'PDS::[\w:]+');

      Best wishes, Paul.

      --- "Brutsch, Michael" <mbrutsch@...> wrote:
      > 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?
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Get email at your own domain with Yahoo! Mail.
      http://personal.mail.yahoo.com/
    • Show all 4 messages in this topic