Windows Phone 7, download xml via ssl with authentication

I am trying to download a file from my provider.

The URL is protected by the base username and password, and everything is sent via ssl.

So I am trying to do this:

        WebClient proxy = new WebClient();

        proxy.DownloadStringCompleted += (o, dscea) => System.Diagnostics.Debugger.Break();
        proxy.Credentials = new NetworkCredential("username", "password");
        proxy.DownloadStringAsync(new Uri("https://..../.../data.xml"));

As you can see, I'm trying to check. The url is correct and the code works when I try to download something from twitter.

And the url works when I enter it in Firefox / Internet Explorer

What do I forget to connect to this XML file?

The error I am getting is the following:

Visual Studio 2010 (, ) CTP:)

+3
2

, -, -. , , .NET auth , . :

var client = new WebClient();

var token = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0}:{1}", username, password)));
var authHeader = string.Format("Basic {0}", token);

client.Headers["Authorization"] = authHeader;
client.DownloadStringCompleted += (s, e) =>
{
   // handle result
};

client.DownloadStringAsync(url);
+6

-, , SSL. SSL Silverlight ( notimplementedException) REGULAR Silverlight.

, , WP7.

+2

Source: https://habr.com/ru/post/1743934/


All Articles