Home > SSIS > Extend the HTTP connection timeout value – SSIS

Extend the HTTP connection timeout value – SSIS


HTTP connection manager has the limitation in timeout property value. So, We cannot give value more than 300 seconds in that property.

pic1But, In my project I must have an extended time limit. Because, I am communication with a server that generates a data file that takes little bit extra time then 300 seconds. So, I was looking for a workaround to overcome this barrier. Then, I found out a class WebClient in .NET library which does solve my problem. But, we need to do some additional work for our convenience.

I am using SSIS Script task to communicate with the web server. I refereed these code1 and code2 to declare my namespace. We are inheriting the WebClient class with constructor to get timeout value while declaring user object variable.

Namespace Declaration:

pic2

Main Code:

This block of code will download a file from the given URI. I have commented the authentication part in this code. Because, it is not required for this example. But, you must use that statements to access authenticated web server.

pic3Package Execution:

pic4

Download WebClient VB.Net Code

Alternate Method

We can use HttpWebRequest and HttpWebResponse .NET class to communicate with the website. In this blog post, I have given an example to download a webpage.

Conclusion:

This code saved me lots of my daylight. So, please feel free to use this code in your project if you need.

As always, please share your thoughts about this blog post and share your ideas too in the comment section.

Advertisements
  1. oliver penney
    June 13, 2013 at 7:23 am

    many many thanks. the 300 limit was killing me and having translated that into c# it looks to be working

    had to add an

    myWebClient.Credentials = CredentialCache.DefaultCredentials;

    because my website is internal and needs network credentials

  2. Jeroen
    November 19, 2014 at 4:00 am

    Hacking the SSIS package, by opening the dtsx package in notepad and changing the timeout from 300 to 3000 works as well.

    • November 19, 2014 at 1:02 pm

      Awesome!!!

      Updated: 4/14/2015
      I did check this recently and found issue. can you please share your solution?

    • April 9, 2015 at 5:26 pm

      Grrr… that actually didn’t work. I just tried that and I get “Exception from HRESULT: 0xC0016010”. I set the timeout back to 300 and the exception goes away. This is SSIS 2012.

  3. Jeroen
    April 30, 2015 at 4:32 am

    Maybe this hack has been fixed in newer versions. I can confirm it works in SSIS 2008. Sorry gents

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: