【发布时间】:2012-02-14 09:49:53
【问题描述】:
我正在 WCF 服务和 Windows Phone 客户端应用程序中开发解决方案。问题是当我在 Internet Explorer 中键入服务地址时,即使在模拟器中也无法连接到服务,我得到了正确的结果。 我的配置文件:
<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 应用程序不能。
【问题讨论】:
标签: wcf windows-phone