我正在尝试调用Web服务几个小时。 我已经加入clientaccesspolicy.xml:远程服务器返回错误:NotFound。 Silverlight + WCF
<?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。
这是日志从小提琴手:
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;
}
我在做什么错?
验证您的端点配置是否正确。如果您使用基于wsdl的Visual Studio构建的代理类,您还可以检查它是否正确定义(尤其是,如果它包含UserExist方法并使用适当的参数) – 2012-02-17 21:44:06