2011-08-02 7 views
0

클라우드에 배포 된 wcf 데이터 서비스를 사용하는 실버 라이트 응용 프로그램을 만들고 있습니다. WCF 데이터 서비스는 브라우저에서 완벽하게 작동하지만 dataservice 쿼리로 컨트롤을 채우고 loadasync 메서드를 사용할 때 아래 오류가 발생합니다.wcf 데이터 서비스에 액세스 할 때 Silverlight 보안 예외가

clientaccesspolicy.xml 및 crossdomain.xml이 포함되어 있으며 모든 도메인에 액세스 할 수 있으며 열려 있습니다.

필자는 피들러를 사용했으나 clientaccesspolicy.xml 파일을 검색하려고 시도하지 않았습니다. 그 전에는 오류가 발생했습니다.

누군가가 적어도 잘못 된 것을 찾는 방법을 알고 있습니까?

e.Error {System.InvalidOperationException :이 요청을 처리하는 동안 오류가 발생했습니다. ---> System.Security.SecurityException ---> System.Security.SecurityException : 보안 오류입니다. 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 (sendState 개체) 내부 예외 스택 추적 --- --- 끝에서 System.Net.Browser.AsyncHelper.BeginOnUI (SendOrPostCallback beginMethod, 객체 상태)에서 System.Net . System.Data.Services.Client.QueryResult.AsyncEndGetResponse (IAsyncResult를 asyncResult) --- 내부의 끝에서 System.Data.Services.Http.ClientHttpWebRequest.EndGetResponse (IAsyncResult를 asyncResult) 에서 Browser.ClientHttpWebRequest.EndGetResponse (IAsyncResult를 asyncResult) 예외 스택 추적 --- 에서 System.Data.Services.Client.BaseAsyncResult.EndExecute [T] (개체 소스, String 메서드, IAsyncResult asyncResult) at System.Data.Services.Client.QueryResult.EndExecute [TElemen (Object source, IASyncResult asyncResult) at System.Data.Services.Client.DataServiceQuery 1.EndExecute(IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceCollection 1. < (개체 소스, > System.Data.Services.Client.DataServiceCollection 1.<>c__DisplayClass2.<LoadAsync>b__1(IAsyncResult asyncResult) at System.Data.Services.Client.DataServiceCollection에서 System.Data.Services.Client.DataServiceCollection 1.<>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.DataServiceQuery 1.EndExecute (IAsyncResult를 asyncResult)에서 C_ DisplayClass2.b _1 (IAsyncResult를 asyncResult) 1 <> C_ DisplayClassd . <> c _DisplayClassf.b_ b()} 데이터 : {System.Collections.ListDictionaryInternal} InnerException : {System.Security.SecurityException ---> System.Security.SecurityException : 보안 오류입니다. 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 (sendState 개체) --- System.Net에서 System.Net.Browser.AsyncHelper.BeginOnUI (SendOrPostCallback beginMethod, 객체 상태)에서 내부 예외 스택 추적 --- 끝. Browser.ClientHttpWebRequest.EndGetResponse (IAsyncResult를 asyncResult) System.Data.Services.Client.QueryResult에서 System.Data.Services.Http.ClientHttpWebRequest.EndGetResponse (IAsyncResult를 asyncResult) 에서 .AsyncEndGetResponse (IAsyncResult asyncResult)} 메시지 : "이 요청을 처리하는 동안 오류가 발생했습니다." StackTrace : "System.Data.Services.Client.BaseAsyncResult.EndExecute [T] (개체 소스, String 메서드, IAsyncResult asyncResult) \ r \ n System.Data.Services.Client.QueryResult.EndExecute에서 [TElement] (Object 원본, IAsyncResult asyncResult) System.Data.Services.Client.DataServiceQuery에서 System.Data.Services.Client.DataServiceRequest.EndExecute [TElement] (개체 소스, DataServiceContext 컨텍스트, IAsyncResult asyncResult) \ r \ n에서 \ r \ n 1.EndExecute(IAsyncResult asyncResult)\r\n at System.Data.Services.Client.DataServiceCollection 1 . <> C _DisplayClass2.b_ 1 (IAsyncResult를 asyncResult) \ R \ n에서 System.Data.Services.Client.DataServiceCollection`1. <> C _DisplayClassd. <> C_ DisplayClassf.b _B() "

답변

0

같은 문제가있었습니다. 내 clientaccesspolicy로드있어 브라우저 캐시를 삭제 한 후

<?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> 

하고 그것을 잘 작동합니다 : 난 내 clientaccesspolicy.xml을 변경했습니다. 도움이 되길 바랍니다.

+0

피들러로 브라우저 캐시를 지웠다는 것을 깜빡하고 있습니다. IE로 지우는 것이 문제를 해결하지 못했습니다. – Alex

관련 문제