Waiting for XML to load(C#)?



I am trying to load an XML document from a dynamically generated URL from another service. For instance, my application first request a URL and receive a response like the following:



http://ift.tt/1J94wBL


Then my application attempts to create an XML document from the XML at the URL. The problem is that the URL is not immediately active- so my program crashes when it attempts to create the XML Document. It takes anywhere between 10 seconds to 60 seconds for the URL to be active depending on the original request(and then it continues to be active indefinitely). My question is: How do I know that the URL is active so I can make my application only attempt to generate the XML Document when the URL is ready ? Thanks for any help !


No comments:

Post a Comment