I can't get atom data from twitter...


  • Can anybody help me with this problem?? Just intoduction about what i want to do.I just want to get twitter Twit and show it in my silverlight application.And  run in web browser. And I Have code like this :

     WebClient client = new WebClient();
    client.DownloadStringAsync(new Uri(""));
    client.DownloadStringCompleted += (s, ea) =>
    busyTweets.IsBusy = false;
    XDocument doc = XDocument.Parse(ea.Result, LoadOptions.PreserveWhitespace);
    XNamespace ns = "";

    var items = from item in doc.Descendants(ns + "entry")
    select new TwitterDataModel()
    Title = item.Element(ns + "title").Value,

    Image = new Uri((
    from XElement xe in item.Descendants(ns + "link")
    where xe.Attribute("type").Value == "image/png"
    select xe.Attribute("href").Value

    Link = new Uri((from XElement xe in item.Descendants(ns + "link")
    where xe.Attribute("type").Value == "text/html"
    select xe.Attribute("href").Value).First<string>())

    foreach (TwitterDataModel t in items)

    First i tried @Wifi public restaurant and it get works.I Can get Data from But when i want to try at my home, 
    i've got this message in the inner exception : 
    {System.Security.SecurityException ---> System.Security.SecurityException: Security error.
    at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
    at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)
    at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)
    --- End of inner exception stack trace ---
    at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
    at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
    at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
    at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)}
    can anybody help me with this situations?? I don't have any clue to solve this problem..Thx...
    nb: i've been read another thread that has simmiliar problem and it talk about clientaccesspolicy.xml..What is that? And how to use that file.
    I'm running this code in debug mode. and At my home.thx
    Monday, May 07, 2012 12:46 PM


  • Hi Seandy,

    I suggest you use Fiddler and it will show the detailed http request and responce.

    You will see on which request the error is thrown.


    Best Regards,

    Wednesday, May 09, 2012 2:49 AM

All replies