C# 从Localhost dev到prod server的具有WCF服务的WPF客户端?
我刚刚开始学习WCF。我已成功使用主机控制台应用程序设置WCF服务。该服务映射到具有实体框架的SQL Server。然后我有一个WPF客户端应用程序,它使用该服务。这一切都可以在Dev中正常工作,无论是从我的机器上运行的服务还是客户端应用程序:C# 从Localhost dev到prod server的具有WCF服务的WPF客户端?,c#,wpf,web-services,wcf,mvvm,C#,Wpf,Web Services,Wcf,Mvvm,我刚刚开始学习WCF。我已成功使用主机控制台应用程序设置WCF服务。该服务映射到具有实体框架的SQL Server。然后我有一个WPF客户端应用程序,它使用该服务。这一切都可以在Dev中正常工作,无论是从我的机器上运行的服务还是客户端应用程序: <endpoint address="http://localhost:8081/" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRegimesSer
<endpoint address="http://localhost:8081/" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IRegimesService" contract="RegimesService.IRegimesService"
name="BasicHttpBinding_IRegimesService" />
您需要确保服务器能够解析完整的域名
另外,客户端配置代码段
中提供的地址url有问题吗?谢谢@Seymour,添加服务引用向导现在接受地址和搜索,但不返回服务,尽管服务在服务器上运行,但会出现超时异常。您可能希望启用WCF跟踪并查看日志。。
<services>
<service name="diiRegimesService.RegimesService">
<endpoint address="" binding="basicHttpBinding" contract="diiRegimesService.IRegimesService"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8082" />
</baseAddresses>
</host>
</service>
</services>
<client>
<endpoint address="http://emea-myserver01.emea.basketballinfo.com/localhost:8082/" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IRegimesService" contract="RegimesService.IRegimesService"
name="BasicHttpBinding_IRegimesService" />
</client>
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://emea-myserver01.emea.basketballinfo.com/'.