gpt4 book ai didi

c# - 远程服务器返回错误 : NotFound. Silverlight + WCF

转载 作者:行者123 更新时间:2023-11-30 13:49:30 24 4
gpt4 key购买 nike

我尝试调用网络服务几个小时。我添加了 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>

和 crossdomain.xml:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="SOAPAction,Content-Type"/>
</cross-domain-policy>

到我网站的根目录。从 IIS 调用 Web 服务,它在这里工作。

但是当我试图从 silverlight 应用程序调用我的 wcf web 服务时,我得到了这个错误:

远程服务器返回错误:NotFound。

这是来自 Fiddler 的日志:

a:InternalServiceFaultThe server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

这是代码,当我遇到错误时:

public int EndUserExist(System.IAsyncResult result) {
object[] _args = new object[0];
int _result = ((int)(base.EndInvoke("UserExist", _args, result))); //Here
return _result;
}

我做错了什么?

最佳答案

在您的 web.config 中查找以下文本:IncludeExceptionDetailInFaults将其设置为真。然后再次运行您的服务请求并观察 Fiddler 这次它会告诉您您需要了解的内容。可能是从 SQL 错误到空引用的任何内容。 :-)

关于c# - 远程服务器返回错误 : NotFound. Silverlight + WCF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9335789/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com