wcf - 从 Silverlight 调用 WCF 服务

标签 wcf silverlight securityexception

我从 Silverlight 调用本地托管的 wcf 服务,但出现以下异常。

我创建了一个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>

An error occurred while trying to make a request to URI 'http://localhost:8005/Service1.svc'. This could be due to a cross domain configuration error. Please see the inner exception for more details. --->

{System.Security.SecurityException ---> System.Security.SecurityException: Security error. at MS.Internal.InternalWebRequest.Send() at System.Net.BrowserHttpWebRequest.BeginGetResponseImplementation() at System.Net.BrowserHttpWebRequest.InternalBeginGetResponse(AsyncCallback callback, Object state) at System.Net.AsyncHelper.<>c__DisplayClass4.b__3(Object sendState) --- End of inner exception stack trace --- at System.Net.AsyncHelper.BeginOnUI(BeginMethod beginMethod, AsyncCallback callback, Object state) at System.Net.BrowserHttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteSend(IAsyncResult result) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnSend(IAsyncResult result)}



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

最佳答案

有一些调试技巧listed here ..还有一个useful post ..

关于wcf - 从 Silverlight 调用 WCF 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/122144/

相关文章:

javascript - 从 javascript 调用 WCF 方法

WPF 与 Silverlight

c# - 网络共享上的 .NET 4.0 应用程序导致 SecurityException

c# - .NET 中的生产者/消费者模式

wcf - dns 标记是 web.config WCF

html - 如何在 Silverlight 文本 block 中显示简单的 HTML?

c# - 自定义 Silverlight 启动画面导致白屏死机

Java - 方法 "printDuplicates"中的 SecurityException

java - 即使更换加密策略 Jar 后仍出现 SecurityException

c# - WCF 无法从 net.tcp 获取元数据