从Silverlight调用WCF服务

Dan*_*Dan 4 silverlight wcf securityexception

我从silverlight调用本地托管的wcf服务,我在下面得到了例外.

Iv创建了一个clientaccesspolicy.xml,它位于我的主机路由中.

<?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>
Run Code Online (Sandbox Code Playgroud)

尝试向URI" http:// localhost:8005/Service1.svc " 发出请求时发生错误.这可能是由于跨域配置错误.有关更多详细信息,请参阅内部异常.--->

{System.Security.SecurityException ---> System.Security.SecurityException:安全错误.在MS.Internal.InternalWebRequest.Send()在System.Net.BrowserHttpWebRequest.BeginGetResponseImplementation()在System.Net.BrowserHttpWebRequest.InternalBeginGetResponse(AsyncCallback的回调,对象状态)在System.Net.AsyncHelper.<> c__DisplayClass4.b__3(对象sendState )---内部异常堆栈跟踪的末尾在System.Net.AsyncHelper.BeginOnUI(beginMethod beginMethod,AsyncCallback的回调,对象状态)在System.Net.BrowserHttpWebRequest.BeginGetResponse(AsyncCallback的回调,对象状态)在System.ServiceModel .Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteSend(IAsyncResult的结果)在System.ServiceModel.Channels.HttpChannelFactory.

关于如何进步的任何想法?

Gul*_*zim 7

这里列出了一些调试技术.. 一个更有用的帖子 ..