【发布时间】:2012-06-16 20:40:09
【问题描述】:
在我将 WCF Web 服务部署到 Windows Server 2008 R2 后,我能够在“http://192.168.100.22:4567/HrmsService.svc”处拥有一个页面,这在服务器上有效,但在我的 PC 上无效。 我创建了一个 Windows 窗体应用程序,并尝试将其添加为服务参考,但出现如下错误消息。我在服务器上安装了 VS2010,并尝试将其添加为服务参考,它适用于 Windows 窗体应用程序。我什至在服务器防火墙中添加了端口 4567 以允许它。 我今天早上尝试了所有,但我无法弄清楚。请告诉我。
错误信息
下载时出错 'http://192.168.100.22:4567/HrmsService.svc?wsdl'。无法连接 到远程服务器 连接尝试失败,因为已连接 当事人在一段时间后没有正确回应,或建立 连接失败,因为连接的主机没有响应 192.168.100.22:4567 元数据包含无法解析的引用:“http://192.168.100.22:4567/HrmsService.svc?wsdl”。有 没有端点监听 'http://192.168.100.22:4567/HrmsService.svc?wsdl' 可以接受 信息。这通常是由不正确的地址或 SOAP 操作引起的。 有关更多详细信息,请参阅 InnerException(如果存在)。无法连接到 远程服务器连接尝试失败,因为已连接 当事人在一段时间后没有正确回应,或建立 连接失败,因为连接的主机没有响应 192.168.100.22:4567 如果在当前解决方案中定义了服务,请尝试构建解决方案并再次添加服务引用。
这是我的 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>
【问题讨论】:
标签: c# wcf windows-server-2008