locked
Silverlight WebClient.DownloadStringAsync Fails quietly on HTTPS when executed out of the browser RRS feed

  • General discussion

  • Hi Friends

     I have an strange problem (Using Silverlight 5 on WindowsXPSP3). Below is the step by step details of what I am doing  

    1. I have an Application That uses WebClient to download a small XMLFile from the same server on which Silverlight page is hosted (no Cross Domain issue)
    2. Application is deploying on IIS 7
    3. I need to access it via HTTP and HTTPS both
    4. Application works fine (i.e. download the file as expected) when executed inside the browser
    5. No I am installing as OOB while pointing to HTTP endpoint
    6. Application work fine when started as OOB (When Installed via HTTP end point)
    7. Now I am reloading the application in browser via HTTPS end point
    8. Now reinstalling application as OOB
    9. After starting the application as OOB (Installed via HTTPS end Point) and trying to download the configuration file
    10. Though no exception get but it seem download never complete and “xmlClient.DownloadStringCompleted” is never get fired
    11. I am able to access same file via browser from both endpoints HTTP and HTTPS

     Code Snippet that I am using

     

      private static void DownLoadConfigurationFile()
    {
                   WebClient xmlClient = new WebClient();
                  xmlClient.UseDefaultCredentials = true;
                      xmlClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(XMLFileLoaded);
                    xmlClient.DownloadStringAsync(new Uri("ServiceConfiguration.xml", UriKind.RelativeOrAbsolute));
    }
    
    private static void XMLFileLoaded(object sender, DownloadStringCompletedEventArgs e)
            {
                if (e.Error == null)
                {
                    ConfigXML = XDocument.Parse(e.Result);
                    OnConfigInitCompleteEvent(new DownloadCompleteEnentArgs(null));
                    IsInitComplete = true;
                }
            }

    Any pointer will be great help

    Regards

    Monday, August 20, 2012 11:03 AM