【发布时间】:2014-11-13 14:35:42
【问题描述】:
我刚刚开始学习 WCF。我已经成功地使用主机控制台应用程序设置了 WCF 服务。该服务使用实体框架映射到 SQL Server。然后我有一个使用该服务的 WPF 客户端应用程序。这一切在 Dev 中运行良好,服务和客户端应用程序都在我的机器上运行:
<endpoint address="http://localhost:8081/" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IRegimesService" contract="RegimesService.IRegimesService"
name="BasicHttpBinding_IRegimesService" />
我现在已将服务和主机转移到我的新虚拟机上。服务主机运行良好。我现在正在尝试配置客户端应用程序端点以连接到服务。我认为HTTP地址不正确:
服务app.config:
<services>
<service name="diiRegimesService.RegimesService">
<endpoint address="" binding="basicHttpBinding" contract="diiRegimesService.IRegimesService"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8082" />
</baseAddresses>
</host>
</service>
</services>
客户端app.config:
<client>
<endpoint address="http://emea-myserver01.emea.basketballinfo.com/localhost:8082/" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IRegimesService" contract="RegimesService.IRegimesService"
name="BasicHttpBinding_IRegimesService" />
</client>
远程桌面的服务器凭据是:emea-myserver01.emea.basketballinfo.com
我目前没有在我的客户端 app.config 中指定用户名和密码。
服务正在服务器上运行。我在尝试在客户端应用程序中添加服务引用时遇到异常。
添加服务参考地址:http://EMEA-myserver01.emea.basketballinfo.com
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://emea-myserver01.emea.basketballinfo.com/'.
【问题讨论】:
-
您有问题吗?
标签: c# wpf web-services wcf mvvm