Extending InfoPath Web Service Query Time-Out
InfoPath has a default web service request / query timeout of 30 seconds. As to hwo to increase this value… it was surprisingly hard to locate as if we were the first to want to do this.
Why would you need to extend the timeout? Two cases we have found while using InfoPath to test our BizTalk orchestrations.
- JIT time slows the query down past 30 seconds therefore the first ‘fresh’ request to the orchestrations results in timeout .
- The processing required to service our request takes longer than 30 seconds to complete therefore every request will result in a timeout.
This problem can be easily fixed. In short, we want to replace the default ‘run query’ or ‘submit’ button with a ‘rules and custom code’ button that specifies a new timeout value before performing the action. Here are the instructions for modifying ‘run query’:
- Double click the ‘Run Query’ button while in design mode
- Click ‘Edit Form Code…’ (this will bring up the MS Script Editor)
- In the ‘OnClick’ function for the target button, insert the following code segment for a 120 second timeout value:
XDocument.QueryAdapter.Timeout = 120;
XDocument.QueryAdapter.Query();
Simple fix.