[英]Host WCF in Windows server 2008 R2 and IIS7.5
After I deployed WCF web service to Windows server 2008 R2, I was able to have a page at "http://192.168.100.22:4567/HrmsService.svc" This works on the server, but not on my PC. 将WCF Web服务部署到Windows Server 2008 R2后,我可以在“ http://192.168.100.22:4567/HrmsService.svc”上找到一个页面。该页面在服务器上有效,但在我的PC上无效。 I created a windows form application and I tried add it as service reference, but there is on error message like below.
我创建了一个Windows窗体应用程序,并尝试将其添加为服务引用,但是出现了如下错误消息。 I installed VS2010 on the server , and I tried to add it as service reference and it works for windows form application.
我在服务器上安装了VS2010,并尝试将其添加为服务引用,并且适用于Windows窗体应用程序。 I even added port 4567 in the server firewall to allow it.
我什至在服务器防火墙中添加了端口4567以允许它。 I tried for all this morning, but I could not figure out.
今天早上我尽力了,但我不知道。 Please, let me know.
请告诉我。
Error Message
错误信息
There was an error downloading 'http://192.168.100.22:4567/HrmsService.svc?wsdl'.
下载'http://192.168.100.22:4567/HrmsService.svc?wsdl'时出错。 Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.100.22:4567 Metadata contains a reference that cannot be resolved: 'http://192.168.100.22:4567/HrmsService.svc?wsdl'.
无法连接到远程服务器连接尝试失败是因为被连接方在一段时间后未正确响应,或者建立的连接失败是因为连接的主机未能响应192.168.100.22:4567元数据包含无法解析的引用: 'http://192.168.100.22:4567/HrmsService.svc?wsdl'。 There was no endpoint listening at 'http://192.168.100.22:4567/HrmsService.svc?wsdl' that could accept the message.
没有终结点在“ http://192.168.100.22:4567/HrmsService.svc?wsdl”上接受该消息的端点。 This is often caused by an incorrect address or SOAP action.
这通常是由不正确的地址或SOAP操作引起的。 See InnerException, if present, for more details.
有关更多详细信息,请参见InnerException(如果存在)。 Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.100.22:4567 If the service is defined in the current solution, try building the solution and adding the service reference again.
无法连接到远程服务器连接尝试失败,因为一段时间后连接方未正确响应,或者连接建立失败,因为连接的主机未能响应192.168.100.22:4567如果服务在当前解决方案中定义,请尝试构建解决方案并再次添加服务参考。
This is my Web.config file. 这是我的Web.config文件。
<system.web>
<compilation debug="true" targetFramework="4.0"><assemblies><add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /></assemblies></compilation>
</system.web>
<system.serviceModel>
<services>
<service name="WcfServiceHrms.HrmsService" behaviorConfiguration="BehaviorHrms">
<endpoint address= "" binding="wsHttpBinding" contract="WcfServiceHrms.IHrmsService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://192.168.100.22:4567" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="BehaviorHrms">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
99% that this error is related to network configuration and has nothing to do with WCF. 99%的用户认为此错误与网络配置有关,与WCF无关。
Try telnet 192.168.100.22 4567 尝试telnet 192.168.100.22 4567
http://technet.microsoft.com/en-us/library/cc771275(v=ws.10).aspx http://technet.microsoft.com/en-us/library/cc771275(v=ws.10).aspx
Move your service to port 80. Not standard ports are often closed by firewalls. 将服务移至端口80。防火墙通常不会关闭标准端口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.