[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Set the time out limited



OK I don't understand. Why do you want your web service server to send back a byte every 30 seconds? Just to keep the connection between the two alive? Most of the time when you call a web service you make the call, get your data, and then you are done. You would want to close the connection. And, like Scott said earlier if you were downloading a file that takes an hour, a timeout would not take effect until the download stopped completely. 

Thanks!
Jason E. Olson
IBM i (AS/400) Engineer
Von Maur
Office: 563.388.2215
Cell: 480.223.2952
E-Mail: jolson@xxxxxxxxxxx

Beauty through function and simplification.
Raymond Loewy
Please consider the environment before printing this e-mail.


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of vanderWalt.Devlyn@xxxxxxxxxxxxxx
Sent: Tuesday, November 20, 2012 3:25 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Set the time out limited

Thomas 

You have giving me great idea's, I still want to try and see if I can get our web services server to send back a byte every 30 seconds, but if this fails then what you suggest can work well. Thank  a lot.

Enjoy
Devlyn



From:   thomas.raddatz@xxxxxx
To:     ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Date:   2012/11/20 11:12 AM
Subject:        Re: Set the time out limited
Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx




HTTP_TIMEOUT is a constant which is declared in CONFIG_H. Personally I do not believe that it is a good idea to change that constant. Instead of chaning HTTP_TIMEOUT you better replace HTTP_TIMEOUT with a value of your choise like that:

   http_url_post_xml( ServiceURL
                    : %addr(SOAP) + 2
                    : %len(SOAP)
                    : %paddr(StartOfElement)
                    : %paddr(EndOfElement)
                    : *NULL
                    : 120              // 120 seconds timeout
                    : HTTP_USERAGENT
                    : 'text/xml'
                    : 'WebServiceControl');

Another option is to declare your own constant or to use a procedure to return the timeout value:

   http_url_post_xml( ServiceURL
                    : %addr(SOAP) + 2
                    : %len(SOAP)
                    : %paddr(StartOfElement)
                    : %paddr(EndOfElement)
                    : *NULL
                    : MY_HTTP_TIMEOUT
                    : HTTP_USERAGENT
                    : 'text/xml'
                    : 'WebServiceControl');

or

   http_url_post_xml( ServiceURL
                    : %addr(SOAP) + 2
                    : %len(SOAP)
                    : %paddr(StartOfElement)
                    : %paddr(EndOfElement)
                    : *NULL
                    : getTimeoutValue()
                    : HTTP_USERAGENT
                    : 'text/xml'
                    : 'WebServiceControl');

If you use a procedure to read the timeout value from a database you can change it a runtime without recompiling. You are even able to pass a parameter to the procedure to specify which timeout value to use, for
example:

   getTimeoutValue(serversIpAddrAsPartOfTheServiceURL);

or

   getTimeoutValue(ServiceURL);

That way you can configure individual timeout values for your services.

Thomas


ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 20.11.2012 07:22:41:

> Von: vanderWalt.Devlyn@xxxxxxxxxxxxxx
> An: ftpapi@xxxxxxxxxxxxxxxxxxxxxx,
> Datum: 20.11.2012 07:32
> Betreff: Re: Set the time out limited
> Gesendet von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> 
> Scott
> 
> That was very useful information. So this is our API that I believe we
are 
> using:
> 
>         http_url_post_xml( ServiceURL
>                          : %addr(SOAP) + 2
>                          : %len(SOAP)
>                          : %paddr(StartOfElement)
>                          : %paddr(EndOfElement)
>                          : *NULL
>                          : HTTP_TIMEOUT
>                          : HTTP_USERAGENT
>                          : 'text/xml'
>                          : 'WebServiceControl');
> 
> I see the "timeout" parameter is HTTP_TIMEOUT, I assume it to be 
> global variable, would you maybe know how I could go about finding 
> where it is declared and maybe how to set it? I suspect it to be a 
> default variable with the HTTP API, am I wrong?
> 
> Also we using a windows web services server. I would to know, is it 
> possible for a web services server to send a byte back every 30 seconds?


> and will that keep the connect alive? 
> 
> Enjoy
> Devlyn
> 
> 
> 
> 
> 
> From:   Scott Klement <sk@xxxxxxxxxxxxxxxx>
> To:     HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Date:   2012/11/19 05:13 PM
> Subject:        Re: Set the time out limmited
> Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> 
> 
> 
> Devlyn,
> 
> "Timeout" is one of the parameters to the APIs.   You can set it to any 
> value you like.  For example:
> 
>       rc = http_get( myURL: myStmf: 120 );
> 
> In the above example, I've set the timeout to 120 seconds.    All of the 


> HTTP APIs that perform network access have a timeout parameter. Check 
> the parameter lists in HTTPAPI_H for the API you're calling.
> 
> Also...  the way the timeout works:  It's NOT measuring the total 
> run-time of the API.  Instead, it's measuring the "lull" time on the 
> connection.  So..  suppose you are downloading a very large file with 
> HTTPAPI, and it will take 1 hour to download.  A timeout of 60 seconds 
> is no problem, here...   it does not matter that the file download takes 


> an entire hour, because the "60 seconds" is not measuring the download 
> time.   AS long as you receive at least 1 byte every 60 seconds, HTTPAPI 


> will be happy.   However, if it should occur that HTTPAPI receives 
> nothing for 60 seconds (not even a single byte) then it will close the 
> connection and report a timeout error.
> 
> But, yeah, you can set it to a higher number... just change the timeout 
> parameter.  The only "thing to watch out for" is that dead connections 
> will take longer to time out.
> 
> -SK
> 
> On 11/19/2012 4:10 AM, vanderWalt.Devlyn@xxxxxxxxxxxxxx wrote:
> >     Hi All
> >     We are starting to notice when a few of our processes that take 
> longer
> >     than a minute, we start getting time out errors.  Is there a way 
to
> >     increase the time out limit?  And in doing so what must one look 
out
> >     for?
> >     Enjoy
> >     Devlyn
> >
> 
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
> 
> 
> 
-------------------------------------------------------------------------------------
> This e-mail is subject to the Columbus Stainless [Pty] Ltd Email 
> Legal Notices available at: 
http://www.columbus.co.za/EmailLegalNotice.htm.
> 
-------------------------------------------------------------------------------------
> 
> This e-mail message has been scanned for Viruses and Content and 
> cleared by MailMarshal
> 
-------------------------------------------------------------------------------------
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------


--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence. Please delete if obtained in error and email confirmation to the 
sender.-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------


-------------------------------------------------------------------------------------
This e-mail is subject to the Columbus Stainless [Pty] Ltd Email Legal Notices available at: http://www.columbus.co.za/EmailLegalNotice.htm.
-------------------------------------------------------------------------------------

This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
-------------------------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------