asynchronous - Errors when trying to use HttpWebRequest in Silverlight 2 -


I am trying to write in the form with an asynchronous call. The example which I have seen should be seen on line It should work, but I keep getting an error.

The first call is made, though debate never calls. Second, I get a system. Security. Security invariable call req.EndGetResponse (a);

What problems might arise?

  Public Partial Category Page: UserControl {URI URL = New Uri ("http://www.google.com", Uricand.Assolute); HttpWebRequest req; Private representative Zero PrintToUIThread (string text); PrintTouuTrade P; Public page () {InitializeComponent (); Rake = (HTTP Web REF) WebRequest.CRETE (URL); P = new printtoaff (print); Req.BeginGetResponse (new Uniconnectback (webcam), Rick); } Zero WebComplete (IAsyncResult A) {try {Dispatcher.BeginInvoke (P)}; HttpWebRequest req = (HttpWebRequest) a.AsyncState; HttpWebResponse Res = (HttpWebResponse) req.EndGetResponse (A); Dispatcher.BeginInvoke (P); } Hold (Exception Pre) {Print (ex.ToString ()); }} Private Zero Print (String Text) {PageTextBox.Text = text; } Private Zero Print () {PageTextBox.Text = "Call from Invitation"; }}  

What I can see from your request / feedback code is something wrong is not . You're probably running a security exception due to cross-domain restrictions specified by Google's crossdomain.exml file.

This is Google's cross domain. Xml is:

  & lt ;? XML version = "1.0"? & Gt; & Lt ;! DOCTYPE cross-domain-policy system "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> & Lt; Cross-domain-policy & gt; & Lt; Site-Control Permission-Cross-Domain-Policies = "By-Content-Type" / & gt; & Lt; / Cross-domain-policy & gt;  

All this is actually saying "Hey, RIA app, use a proxy" Actually, a "WCF" or ASMX web service call with its "Friendly" server Set up with a ClientQuesplici.exm file, use your server to create the http request, then return the result. I'm not sure if Google supports JSONP, but you can try it too.


Comments