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

Q. on HTTP::Daemon... timeout problem...

Expand Messages
  • colin_edwards
    I ve been having some trouble getting the HTTP::Daemon working... I would appreciate any advice you guys can give. The general problem I have is that it
    Message 1 of 3 , Dec 20, 2001
    • 0 Attachment
      I've been having some trouble getting the HTTP::Daemon working... I
      would appreciate any advice you guys can give. The general problem I
      have is that it always seems to timeout, and never actually return
      back an answer. Anyway, below is the source code and output.

      I turned on the on_action function in daemon to see if it was
      actually getting something (it seems to be), but the results are the
      same on the client without that in.





      # --------------------------------
      # SERVER
      # --------------------------------

      use SOAP::Transport::HTTP;

      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => 1080, Reuse => 1,)
      -> on_action(sub { print $_[2], "\n"; })
      -> dispatch_to('TEST')
      ;

      print "Contact SOAP server at ", $daemon->url, "\n";
      $daemon->handle;

      package TEST;

      sub timecheck {
      return scalar(localtime());
      }


      # --------------------------------
      # CLIENT
      # --------------------------------

      use SOAP::Lite +autodispatch =>
      uri => "http://localhost/TEST",
      proxy => "http://localhost:1080/",
      on_fault => sub {
      my($soap, $res) = @_;
      warn "WARNING: ", ref $res ? $res->faultstring.",
      ".$res->faultdetail : $soap->transport->status, "\n";
      };

      eval {
      print "-->|", TEST->timecheck(), "|<--\n";
      }; &HandleError($@) if $@;

      exit;


      sub HandleError {
      warn "WARNING: @_ \n";
      exit 1;
      }


      # -----------------------------------------------
      # OUTPUT

      Client Output: (server running)
      WARNING: 408 User-agent timeout
      -->|1|<--

      (with server not running)
      WARNING: 500 Could not connect to localhost:1080
      -->|1|<--


      Server Output:
      Contact SOAP server at http://localhost:1080/
      timecheck
    • Duncan Cameron
      Colin Your code works fine for me using ActiveState 5.6.1 on Win98. Have you tried running the server under debug and seeing if the timecheck method is
      Message 2 of 3 , Dec 20, 2001
      • 0 Attachment
        Colin

        Your code works fine for me using ActiveState 5.6.1 on Win98.
        Have you tried running the server under debug and seeing if
        the timecheck method is actually called?

        Regards,
        Duncan Cameron

        On 2001-12-20 colin_edwards <colin.edwards@...> wrote:
        >I've been having some trouble getting the HTTP::Daemon working... I
        >would appreciate any advice you guys can give. The general problem I
        >have is that it always seems to timeout, and never actually return
        >back an answer. Anyway, below is the source code and output.
        >
        >I turned on the on_action function in daemon to see if it was
        >actually getting something (it seems to be), but the results are the
        >same on the client without that in.
        >
        >
        >
        >
        >
        ># --------------------------------
        ># SERVER
        ># --------------------------------
        >
        >use SOAP::Transport::HTTP;
        >
        >my $daemon = SOAP::Transport::HTTP::Daemon
        > -> new (LocalPort => 1080, Reuse => 1,)
        > -> on_action(sub { print $_[2], "\n"; })
        > -> dispatch_to('TEST')
        > ;
        >
        >print "Contact SOAP server at ", $daemon->url, "\n";
        >$daemon->handle;
        >
        >package TEST;
        >
        >sub timecheck {
        > return scalar(localtime());
        >}
        >
        >
        ># --------------------------------
        ># CLIENT
        ># --------------------------------
        >
        >use SOAP::Lite +autodispatch =>
        > uri => "http://localhost/TEST",
        > proxy => "http://localhost:1080/",
        > on_fault => sub {
        > my($soap, $res) = @_;
        > warn "WARNING: ", ref $res ? $res->faultstring.",
        > ".$res->faultdetail : $soap->transport->status, "\n";
        > };
        >
        >eval {
        > print "-->|", TEST->timecheck(), "|<--\n";
        >}; &HandleError($@) if $@;
        >
        >exit;
        >
        >
        >sub HandleError {
        > warn "WARNING: @_ \n";
        > exit 1;
        >}
        >
        >
        ># -----------------------------------------------
        ># OUTPUT
        >
        >Client Output: (server running)
        >WARNING: 408 User-agent timeout
        >-->|1|<--
        >
        >(with server not running)
        >WARNING: 500 Could not connect to localhost:1080
        >-->|1|<--
        >
        >
        >Server Output:
        >Contact SOAP server at http://localhost:1080/
        >timecheck
      • Paul Kulchenko
        Hi, Colin! Same for me. I don t have problems running your code. What s your OS, Perl version? Best wishes, Paul. ...
        Message 3 of 3 , Dec 20, 2001
        • 0 Attachment
          Hi, Colin!

          Same for me. I don't have problems running your code. What's your OS,
          Perl version?

          Best wishes, Paul.

          --- Duncan Cameron <dcameron@...> wrote:
          > Colin
          >
          > Your code works fine for me using ActiveState 5.6.1 on Win98.
          > Have you tried running the server under debug and seeing if
          > the timecheck method is actually called?
          >
          > Regards,
          > Duncan Cameron
          >
          > On 2001-12-20 colin_edwards <colin.edwards@...> wrote:
          > >I've been having some trouble getting the HTTP::Daemon working...
          > I
          > >would appreciate any advice you guys can give. The general
          > problem I
          > >have is that it always seems to timeout, and never actually return
          >
          > >back an answer. Anyway, below is the source code and output.
          > >
          > >I turned on the on_action function in daemon to see if it was
          > >actually getting something (it seems to be), but the results are
          > the
          > >same on the client without that in.
          > >
          > >
          > >
          > >
          > >
          > ># --------------------------------
          > ># SERVER
          > ># --------------------------------
          > >
          > >use SOAP::Transport::HTTP;
          > >
          > >my $daemon = SOAP::Transport::HTTP::Daemon
          > > -> new (LocalPort => 1080, Reuse => 1,)
          > > -> on_action(sub { print $_[2], "\n"; })
          > > -> dispatch_to('TEST')
          > > ;
          > >
          > >print "Contact SOAP server at ", $daemon->url, "\n";
          > >$daemon->handle;
          > >
          > >package TEST;
          > >
          > >sub timecheck {
          > > return scalar(localtime());
          > >}
          > >
          > >
          > ># --------------------------------
          > ># CLIENT
          > ># --------------------------------
          > >
          > >use SOAP::Lite +autodispatch =>
          > > uri => "http://localhost/TEST",
          > > proxy => "http://localhost:1080/",
          > > on_fault => sub {
          > > my($soap, $res) = @_;
          > > warn "WARNING: ", ref $res ? $res->faultstring.",
          > > ".$res->faultdetail : $soap->transport->status, "\n";
          > > };
          > >
          > >eval {
          > > print "-->|", TEST->timecheck(), "|<--\n";
          > >}; &HandleError($@) if $@;
          > >
          > >exit;
          > >
          > >
          > >sub HandleError {
          > > warn "WARNING: @_ \n";
          > > exit 1;
          > >}
          > >
          > >
          > ># -----------------------------------------------
          > ># OUTPUT
          > >
          > >Client Output: (server running)
          > >WARNING: 408 User-agent timeout
          > >-->|1|<--
          > >
          > >(with server not running)
          > >WARNING: 500 Could not connect to localhost:1080
          > >-->|1|<--
          > >
          > >
          > >Server Output:
          > >Contact SOAP server at http://localhost:1080/
          > >timecheck
          >
          >
          >
          > ------------------------ 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!?
          Check out Yahoo! Shopping and Yahoo! Auctions for all of
          your unique holiday gifts! Buy at http://shopping.yahoo.com
          or bid at http://auctions.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.