WCF服务WindowsPhone-EndpointNotFoundException

WCF服务WindowsPhone-EndpointNotFoundException,wcf,windows-phone,Wcf,Windows Phone,我正在WCF服务和Windows Phone客户端应用程序中开发解决方案。问题是我无法连接到服务,即使在emulator中,当我在Internet Explorer中键入服务地址时,我也得到了正确的结果。 我的配置文件: <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <bin

我正在WCF服务和Windows Phone客户端应用程序中开发解决方案。问题是我无法连接到服务,即使在emulator中,当我在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>

我的问题是,每次尝试调用客户机代理GetDataAsync()方法时,都不会触发已完成的事件,并且会得到“EndpointNotFoundException”。我已经尝试了我找到的所有解决方案,但没有一个对我有帮助。我还尝试使WPF测试客户端,它可以正常工作,但Windows Phone应用程序不能

我假设这是您的客户端配置,例如电话。您的指向localhost,但由于您在手机上的模拟器中,localhost解析为相同的,而不是服务所在的PC

address="http://localhost:2395/MyCustomService.svc" 

把你电脑的主机名放在那里,你应该会没事的,嗯,我不知道它是怎么开始工作的,但它做到了。我上传我的服务到互联网托管和删除所有服务参考从我的手机客户端项目,并添加他们再次与互联网地址,它现在的工作。谢谢你的帮助,多米尼克

不幸的是,这不起作用。我甚至把它放在了网上,现在仍然是。引发EndpointNotFound异常。(在模拟器和设备上也会发生这种情况)
address="http://localhost:2395/MyCustomService.svc"