function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JimmmyJimmmy 

remoteFunction Timeout not working!?

We are using the remoteFunction and we have set a timeout but it still defaults to the 10 second timeout? 
Here is the code we are using.
 
sforce.connection.remoteFunction({ url : url,
timeout : 60000,
method: "POST",
requestData: template,
async: false,
requestHeaders: { "Content-Type": "text/xml","SOAPAction": https://www.ourwebsite.com},
    onSuccess : function(response) { message = response;},
    onFailure : function(error) { alert(error); }});
 
we pass in XML and retrieve XML as a response.  It works great until we have a larger sized XML
being sent and then we run into issues.  The server is receiving the data and the remoteFunction
is not paying attention to the timeout call. So we get
 
<html>
<head><title>400 Unable to forward request due to: Read timed out</title></head>
<body>
<h1>400 Unable to forward request due to: Read timed out</h1>
<p /><hr />
<small>
Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)
</small>
</body></html> 
 
Does anybody have any ideas or know of any work a rounds... Any help will be greatly appreacheated.
Ron HessRon Hess
The timeout is not configurable at all, it is currently set to 10 seconds.

If you have large requests, simply set the HTTP header "Range" and hope that the server you are talking to will resepct that header and give you only what you asked for.

Note:the max size is 32K for a response string that you can use, otherwise you get an exception.

how much data are you looking for ?

 
JimmmyJimmmy
We are sending only about 9kb.  But the issue is that our server processes the data then sends a response with some confirmation information.  which with larger data takes about 15 seconds and the timeout is initiated before the response comes back.  Can you explain how the HTTP header "Range" will help with SalesForce not timing out?
Ron HessRon Hess
Range will only help with size, not timeout. Unless asking for a smaller size is going to allow the request to return in less than 10 seconds, it does not sound like that will help in your case.
JimmmyJimmmy
So is there anything I can do to keep the connection open for a longer period? or is there another method of posting that would allow for a longer timeout?  Thanks for you help.