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

Re: [soaplite] SOAP::Lite & WSDL - some questions (long)

Expand Messages
  • Mental
    ... ... Forgive the question, but can you set a timeout for something you re accessing via - service similarly? Detecting a fault is great! No results
    Message 1 of 8 , Dec 4, 2001
    View Source
    • 0 Attachment
      On Tue, Nov 13, 2001 at 09:57:28AM -0800, Paul Kulchenko wrote:
      > Hi, Alexei!
      >
      <SNIP>
      > Sorry, I wasn't clear. You can access SOM object using call() method
      > without parameters, like this:
      >
      > my $service = SOAP::Lite->service(...);
      > my $result = $service->method();
      > die $service->call->faulstring if $service->call->fault;
      >

      Forgive the question, but can you set a timeout for something you're
      accessing via ->service similarly? Detecting a fault is great! No results
      is different from an error, and its nice to catch them. However I'd also
      like to be able to specify a timeout. I'm looking but dont see how to d
      this unless you're using the ->proxy method. I'm looking at the code for
      SOAP::Lite::Transport::HTTP::Client and not seeing what I should be
      seeing...

      If SOAP::Transport::HTTP::Client ISA LWP::UserAgent then I should be able
      to set a timeout for the session.... right?



      --
      Mental (Mental@...)


      GPG public key: http://www.neverlight.com/Mental.asc
    • Paul Kulchenko
      Hi, Mental! ... Sure your can ;). Take a look here for more information: http://groups.yahoo.com/group/soaplite/message/830 For you code may look like: $s =
      Message 2 of 8 , Dec 4, 2001
      View Source
      • 0 Attachment
        Hi, Mental!

        --- Mental <Mental@...> wrote:
        > Forgive the question, but can you set a timeout for something
        > you're accessing via ->service similarly?
        Sure your can ;). Take a look here for more information:
        http://groups.yahoo.com/group/soaplite/message/830

        For you code may look like:

        $s = SOAP::Lite->service('http://somewhere/something.wsdl');
        $s->proxy('http://fake/', timeout => 3);

        only protocol part is important for fake proxy. In a similar fashion
        you can specify all other transport parameters, like proxy, cookie
        and the rest.

        > If SOAP::Transport::HTTP::Client ISA LWP::UserAgent then I should
        > be able to set a timeout for the session.... right?
        yes, as well as all other transport options.

        Best wishes, Paul.

        __________________________________________________
        Do You Yahoo!?
        Buy the perfect holiday gifts at Yahoo! Shopping.
        http://shopping.yahoo.com
      • Mental
        ... Hey, thanks! I was reading through the code and was thinking.... why not add a new entry to SOAP::Constants. Something like $CONNECT_TIMEOUT with a
        Message 3 of 8 , Dec 4, 2001
        View Source
        • 0 Attachment
          On Tue, Dec 04, 2001 at 01:16:31PM -0800, Paul Kulchenko wrote:
          > Hi, Mental!
          >
          > --- Mental <Mental@...> wrote:
          > > Forgive the question, but can you set a timeout for something
          > > you're accessing via ->service similarly?
          > Sure your can ;). Take a look here for more information:
          > http://groups.yahoo.com/group/soaplite/message/830
          >
          > For you code may look like:
          >
          > $s = SOAP::Lite->service('http://somewhere/something.wsdl');
          > $s->proxy('http://fake/', timeout => 3);
          >
          > only protocol part is important for fake proxy. In a similar fashion
          > you can specify all other transport parameters, like proxy, cookie
          > and the rest.
          >
          > > If SOAP::Transport::HTTP::Client ISA LWP::UserAgent then I should
          > > be able to set a timeout for the session.... right?
          > yes, as well as all other transport options.
          >
          > Best wishes, Paul.

          Hey, thanks! I was reading through the code and was thinking....

          why not add a new entry to SOAP::Constants. Something like
          $CONNECT_TIMEOUT with a reasonable value. Then in each transport set its
          timeout to that value when you instantiate a new client. It'd be easy to
          do, inside HTTP.pm in sub patch, just set LWP::Useragent's time out to
          $SOAP::Constants::CONNECT_TIMEOUT.

          You way certainly works, its just less hacky looking if there were a
          proper get/set for it. Know what I mean? No need for a fake proxy.

          Or would this be abusing the purpose of SOAP::Constants? I'm still not
          overly familiar with the code base.

          I havent looked at the other protocols yet, so it may not be applicable to
          say... udp protocols. But still. It could be a cool thing to have handy.


          Anyways, just thinking about it...

          Thanks again!

          --
          Mental (Mental@...)


          GPG public key: http://www.neverlight.com/Mental.asc
        Your message has been successfully submitted and would be delivered to recipients shortly.