I have a quite strange situation.
I have this very simple package:
- Task "get list" retrieves a data table from an assembly with one column and a list of URL to be ran into a object variable.
- The "foreach" loop loops through the object variable and loads the URL into a url string variable
The "run", calls the url with this code (its 2005 so Im stuck with VB):
Dim myURI As New Uri("http://" + Dts.Variables("URL").Value.ToString()) Dim myWebClient As New System.Net.WebClient myWebClient.OpenReadAsync(myURI)
the URL being called is internal and just reads the parameters and performs a series of operation which take some time, that's why I used "OpenReadAsync"
My problem is: if I have 4 URLs to run, the package runs only 2 of them. The loop lops 4 times, the script is called 4 times (I can see if I debug it), the line myWebClient.OpenReadAsync(myURI)
is executed 4 times with 4 different values, but only 2 calls to the URL are made.
If I run the package again, the other 2 URLs are now called, which proofs that there isn't anything wrong with the URL and If I call the 4 urls manually on the browser (on 4 tabs for example) one right after another, them all produce the expected result, which proofs that there is nothing wrong with the code that parses the URL.
So I'm left with the VB code, its the first time Im using uri and WebClient so I wonder if Im doing something wrong. I also tried to add a 5 seconds sleep between the calls, but no luck.
Any help would be appreciated. Thanks