I send the data to the server and successfully execute BeginGetRequestStream, then EndGetRequestStream, write the POST data to the RequestStream filling and call BeginGetResponse.
BeginGetResponse successfully returns, and then I call:
Dim response As HttpWebResponse = CType(MyHttpRequest.EndGetResponse(asynchronousResult), HttpWebResponse)
This line throws the following SecurityException:
{System.Security.SecurityException ---> System.Security.SecurityException: Security Error.
in System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse (IAsyncResult asyncResult)
in System.Net.Browser.BrowserHttpWebRequest. <> c__DisplayClass5.b__4 (Object sendState)
in System.Net.Browser.AsyncHelper. <> c__DisplayClass2.b__0 (Object sendState)
--- End internal stack trace ---
in System.Net.Browser.AsyncHelper.BeginOnUI (SendOrPostCallback beginMethod, state of the object)
in System.Net.Browser.BrowserHttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
in EtsyV2NetSL.WebQuery.POST_ResponseCallback (IAsyncResult asynchronousResult )}
So, my first thought was that I was blocked by the server with their clientaccesspolicy.xml or crossdomain.xml. I started 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 look fine:
<!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 am at an impasse trying to solve this problem. I am running a test application on my dev machine from VS.
Does anyone have any ideas as to why Silverlight will throw this error?
thank