我正在開發WCF服務和Windows Phone客戶端應用程序中的解決方案。問題是,當我在Internet Explorer中輸入服務地址時,即使在模擬器中,我也無法連接到服務。我得到正確的結果。 我的配置文件:WCF服務WindowsPhone - EndpointNotFoundException
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyCustomService"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
enableHttpCookieContainer="true"
/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:2395/MyCustomService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyCustomService"
contract="MyService.IMyCustomService" name="BasicHttpBinding_IMyCustomService" />
</client>
</system.serviceModel>
</configuration>
我的服務接口:
[ServiceContract]
[ServiceKnownType(typeof(CustomResponse))]
public interface IMyCustomService
{
[OperationContract]
CustomResponse GetData();
}
我的問題是,每次我試圖在客戶端代理GetDataAsync()方法調用,完成事件不火了,我得到「EndpointNotFoundException」。我嘗試了所有我找到的解決方案,而他們都沒有幫助我。我也嘗試使WPF測試客戶端和它正常工作,但Windows Phone應用程序沒有。
Unfortunatley不起作用。我甚至把它放在了互聯網上。引發EndpointNotFound異常。 (它出現在仿真器和設備上) – TrN 2012-02-15 08:53:20