我正在嘗試調用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