in

InfoPath Dev

How To Increase Web Service Timeout to Allow Large Document Upload

Downloads: 61 File Size: 51kB
Posted By: ErnestoM Views: 105
Date Added: 07-04-2008

If you are having trouble uploading large documents to DBXL you might need to increase the web service timeout to allow the upload enough time to complete.  This can be done on the client side with managed code, or on the server-side (which affects all Document Types) via an edit to the web.config file for the DBXL instance that is causing the problem.

Note that the web.config change noted below is intended to add the <httpRuntime> node into the system.web section, as this node does not already exist in web.config. Also note that this change is only a server-side timeout and Infopath will still timeout after 30 seconds unless you use code to set the timeout.

C#

WebServiceAdapter2 wsAdapter = (WebServiceAdapter2)thisXDocument.DataAdapters["DataConnectionName"];
wsAdapter.Timeout = 60;  // Increase to 60 seconds - Default is 30
wsAdapter.Query(); // Issue the query

JScript 

var wsAdapter = XDocument.DataAdapters["DataConnectionName"];
wsAdapter.Timeout = 60;  // Increase to 60 seconds - Default is 30
wsAdapter.Query(); // Issue the query

web.config change

<configuration>
   <system.web>
      <httpRuntime executionTimeout="300"/>
   </system.web>
</configuration>

Further reference

Filed under:

Comments

No comments exist for this file.
Copyright © 2003-2007 Qdabra Software. All rights reserved.
View our Terms of Use.