[英]WPF Client with WCF Service from Localhost dev to prod server?
我才剛剛開始學習WCF。 我已經使用主機控制台應用程序成功設置了WCF服務。 該服務映射到帶有實體框架的SQL Server。 然后,我有一個使用該服務的WPF客戶端應用程序。 所有這些都可以在Dev中正常運行,無論是從我的機器上運行的服務還是客戶端應用程序:
<endpoint address="http://localhost:8081/" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IRegimesService" contract="RegimesService.IRegimesService"
name="BasicHttpBinding_IRegimesService" />
現在,我已將服務和主機轉移到我的新VM上。 服務主機運行正常。 我現在正在嘗試配置客戶端應用程序端點以連接到服務。 我認為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: 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/'.
您需要確保服務器能夠解析完整的域名。
另外,客戶端配置摘要<endpoint address="http://emea-myserver01.emea.basketballinfo.com/localhost:8082/
中提供的地址url似乎無效。也許您想使用<endpoint address="http://emea-myserver01.emea.basketballinfo.com:8082/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.