0
votes

I am making a silverlight application which uses a wcf data service which is deployed on cloud. The WCF data service works perfectly on the browser,however when I use it as a dataservice query to populate the controls and use the loadasync method i get the below error.

I included the clientaccesspolicy.xml and crossdomain.xml and it is accessible and open to all domains.

I used fiddler but it isn't even trying to retrieve the clientaccesspolicy.xml file rather get the error before that.

Does anyone know how to find what is wrong at least?

e.Error {System.InvalidOperationException: An error occurred while processing this request. ---> System.Security.SecurityException ---> System.Security.SecurityException: Security error. at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.ClientHttpWebRequest.<>c_DisplayClass5.b_4(Object sendState) at System.Net.Browser.AsyncHelper.<>c_DisplayClass4.b_1(Object sendState) --- End of inner exception stack trace --- at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Data.Services.Http.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Data.Services.Client.QueryResult.AsyncEndGetResponse(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult) at System.Data.Services.Client.QueryResult.EndExecute[TElement](Object source, IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceQuery1.EndExecute(IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceCollection1.<>c_DisplayClass2.b_1(IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceCollection1.<>c__DisplayClassd.<>c__DisplayClassf.<BeginLoadAsyncOperation>b__b()} [System.InvalidOperationException]: {System.InvalidOperationException: An error occurred while processing this request. ---> System.Security.SecurityException ---> System.Security.SecurityException: Security error. at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(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.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Data.Services.Http.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Data.Services.Client.QueryResult.AsyncEndGetResponse(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult) at System.Data.Services.Client.QueryResult.EndExecute[TElement](Object source, IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceQuery1.EndExecute(IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceCollection1.<>c__DisplayClass2.<LoadAsync>b__1(IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceCollection1.<>c_DisplayClassd.<>c_DisplayClassf.b_b()} Data: {System.Collections.ListDictionaryInternal} InnerException: {System.Security.SecurityException ---> System.Security.SecurityException: Security error. at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.ClientHttpWebRequest.<>c_DisplayClass5.b_4(Object sendState) at System.Net.Browser.AsyncHelper.<>c_DisplayClass4.b_1(Object sendState) --- End of inner exception stack trace --- at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Data.Services.Http.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Data.Services.Client.QueryResult.AsyncEndGetResponse(IAsyncResult asyncResult)} Message: "An error occurred while processing this request." StackTrace: " at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)\r\n at System.Data.Services.Client.QueryResult.EndExecute[TElement](Object source, IAsyncResult asyncResult)\r\n at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, IAsyncResult asyncResult)\r\n at System.Data.Services.Client.DataServiceQuery1.EndExecute(IAsyncResult asyncResult)\r\n at System.Data.Services.Client.DataServiceCollection1.<>c_DisplayClass2.b_1(IAsyncResult asyncResult)\r\n at System.Data.Services.Client.DataServiceCollection`1.<>c_DisplayClassd.<>c_DisplayClassf.b_b()"

1

1 Answers

0
votes

i had the same issue. i changed my clientaccesspolicy.xml to:

<?xml version="1.0" encoding="utf-8"?> 
<access-policy> 
  <cross-domain-access> 
    <policy> 
      <allow-from http-request-headers="*"> 
        <domain uri="*"/> 
      </allow-from> 
      <grant-to> 
        <resource path="/" include-subpaths="true"/> 
      </grant-to> 
    </policy> 
  </cross-domain-access> 
</access-policy>

after clearing the browser-cache my clientaccesspolicy got loaded and it works fine. hope that helps