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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With