Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight SecurityException

I'm POSTing data to a server and successfully execute BeginGetRequestStream, then EndGetRequestStream, write my POST data to the fill the RequestStream, and call BeginGetResponse.

BeginGetResponse successfully returns and I then call:

Dim response As HttpWebResponse = CType(MyHttpRequest.EndGetResponse(asynchronousResult), HttpWebResponse)

This line throws the folloing SecurityException Error:

{System.Security.SecurityException ---> System.Security.SecurityException: Security error.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.b__0(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 EtsyV2NetSL.WebQuery.POST_ResponseCallback(IAsyncResult asynchronousResult)}

So my first thought was that I was being blocked by the server with their clientaccesspolicy.xml or crossdomain.xml. I've fired up Fiddler and saw the following:

GET http://openapi.etsy.com/clientaccesspolicy.xml > 596 (text/xml)
GET http://openapi.etsy.com/crossdomain.xml > 200 OK (application/xml)

So I checked their crossdomain.xml and the settings appear ok:

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <allow-access-from domain="*"/>
</cross-domain-policy>

I've hit a dead end in trying to solve this problem. I'm running the test app on my dev machine from VS.

Does anyone have any ideas as to why Silverlight would be throwing this error?

Thanks

like image 821
Graeme Avatar asked Nov 05 '22 06:11

Graeme


1 Answers

It seems like it's a client access policy issue, check this:

http://forums.silverlight.net/forums/p/26566/90867.aspx

It worked for me.

like image 123
Jportelas Avatar answered Nov 30 '22 20:11

Jportelas