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

32RE: [soaplite] Subclassing SOAP::Transport::HTTP::Daemon

Expand Messages
  • Paul Kulchenko
    Feb 13, 2001
      Hi, Michael!

      Ok, lets take saop.daemon and modify it to call My::Daemon. Following
      code will work exactly as usual SOAP::Transport::HTTP::Daemon:

      use SOAP::Transport::HTTP;

      my $daemon = My::Daemon
      -> new (LocalAddr => 'localhost', LocalPort => 80)
      -> objects_by_reference(qw(My::PersistentIterator
      My::SessionIterator My::Chat))
      -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name',
      'Module::method')
      ;
      print "Contact to SOAP server at ", $daemon->url, "\n";
      $daemon->handle;

      BEGIN {
      package My::Daemon;
      use SOAP::Transport::HTTP;
      @ISA = 'SOAP::Transport::HTTP::Daemon';
      }

      You may put inside your methods or whatever you want. Hope it helps.

      Best wishes, Paul.

      --- Michael Percy <mpercy@...> wrote:
      > Paul,
      > I tried to subclass it and even used the code from forkingdaemon.pm
      > in my
      > own module but it would not work for me. Have you tried putting the
      > definition of a subclass outside of SOAP/Transport/HTTP.pm and
      > tried to
      > instantiate it? If you could get that to work I would be very much
      > appreciative! (else just tell me I'm being stupid and to try again
      > ;) I
      > tried for several hours yesterday to no avail. (note: it did work
      > if I put
      > my new class in your module file).
      >
      > Thanks!
      > Michael
      >
      > > -----Original Message-----
      > > From: Paul Kulchenko [mailto:paulclinger@...]
      > > Sent: Tuesday, February 13, 2001 2:05 PM
      > > To: soaplite@yahoogroups.com
      > > Subject: Re: [soaplite] Subclassing SOAP::Transport::HTTP::Daemon
      > >
      > >
      > > Hi, Michael!
      > >
      > > Why not? There is no restrictions on subclassing or inheritance.
      > Take
      > > a look into examples/SOAP/Transport/HTTP/ForkingDaemon which is
      > > inherited from SOAP::Transport::HTTP::Daemon.
      > >
      > > As for SIG{INT} I planned to add SIG{PIPE} and SIG{INT} handlers,
      > but
      > > don't do it yet, so if you could provide a code or example I'll
      > > incorporate it into Transport::HTTP::Daemon implementation. Thank
      > > you.
      > >
      > > Best wishes, Paul.
      > >
      > > --- Michael Percy <mpercy@...> wrote:
      > > > Hello,
      > > > I am trying to catch SIG{INT} and gracefully close the
      > connection
      > > > in the
      > > > daemon implementation of the SOAP::Lite server. However, I
      > cannot
      > > > seem to
      > > > subclass SOAP::Transport::HTTP::Daemon!
      > > >
      > > > I believe this problem stems from the fact that all of the
      > > > SOAP::Transport::HTTP::* classes reside in one file:
      > > > SOAP/Transport/HTTP.pm.
      > > > I am perfectly able to "use SOAP::Transport::HTTP" and then
      > > > instantiate a
      > > > ::Daemon class or ::Server class but I cannot for the life of
      > me
      > > > inherit
      > > > from one!
      > > >
      > > > When I put SOAP::Transport::HTTP::Daemon in my @ISA array, even
      > if
      > > > I am
      > > > "use"ing SOAP::Transport::HTTP, when I try to create an object
      > of
      > > > my
      > > > subclass I get the error: 'Can't locate object method "new" via
      > > > package
      > > > "MyDaemon"' (my subclass). It is really strange.
      > > >
      > > > Does the @ISA "classloader" mechanism work differently that the
      > > > @INC
      > > > classloader mechanism? What I mean is, am I doing something
      > > > wrong/being
      > > > stupid, is Perl having problems, or was what the author did an
      > > > unsupported
      > > > use of packages/classes?
      > > >
      > > > Is there a workaround? ( !!! :-)
      > > >
      > > > Hope I have been clear enough!
      > > >
      > > >
      > > > Regards,
      > > >
      > > > Michael Percy
      > > > Software Engineer, Portera Systems
      > > >
      > > > ------------------------ Yahoo! Groups Sponsor
      > > >
      > > > To unsubscribe from this group, send an email to:
      > > > soaplite-unsubscribe@yahoogroups.com
      > > >
      > > >
      > > >
      > >
      > >
      > > __________________________________________________
      > > Do You Yahoo!?
      > > Get personalized email addresses from Yahoo! Mail - only $35
      > > a year! http://personal.mail.yahoo.com/
      > >
      > > ------------------------ Yahoo! Groups Sponsor
      > > ---------------------~-~>
      > > eGroups is now Yahoo! Groups
      > > Click here for more details
      > > http://click.egroups.com/1/11231/1/_/_/_/982101923/
      > > --------------------------------------------------------------
      > > -------_->
      > >
      > > To unsubscribe from this group, send an email to:
      > > soaplite-unsubscribe@yahoogroups.com
      > >
      > >
      > >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Get personalized email addresses from Yahoo! Mail - only $35
      a year! http://personal.mail.yahoo.com/
    • Show all 6 messages in this topic