views:

206

answers:

1

Hi,

I've got the following code:

    public void StartDataRequest()
    {
        WebRequest.RegisterPrefix("https://", System.Net.Browser.WebRequestCreator.ClientHttp);

        WebClient myService = new WebClient
                              {
                                  AllowReadStreamBuffering = true,
                                  UseDefaultCredentials = false,
                                  Credentials = new NetworkCredential("username", "password")
                              };
        myService.UseDefaultCredentials = false;

        myService.OpenReadCompleted += this.RequestCompleted;
        myService.OpenReadAsync(new Uri("Url"));
    }

    public void RequestCompleted(object sender, System.Net.OpenReadCompletedEventArgs e)
    {
        // ...
    }

Now this works perfectly for, say, Twitter. But when I try to do it with another https service I get a security error.

This is probably because the website I try to connect too does not have a crossdomain.xml. Is there a way to bypass this? Or does the file really needs to be there? Thanks.

+1  A: 

Yes the server must have either a ClientAccessPolicy.xml file or a crossdomain.xml file. The only way I know of to get around this is to make you own server side service to act as a proxy.

Arkain