简体   繁体   English

Windows Server 2008 R2和IIS7.5中的主机WCF

[英]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.

相关问题 在Windows Server 2008 R2上使用IIS7.5使用TLS1.2发出请求 - make a request with TLS1.2 using IIS7.5 on Windows Server 2008 R2 在IIS 7.5(Windows 2008 R2)上部署Web应用程序 - Deploying a Web Application on IIS 7.5 (Windows 2008 R2) IIS 7.5 Windows Server 2008 R2 偶尔会从不同帐户返回页面 - IIS 7.5 Windows Server 2008 R2 Very occasionally returns page from different account 在IIS7.5上的Windows 2008R2上使用Telerik RadCaptcha出现404错误 - 404 error using telerik RadCaptcha on Windows 2008R2 on IIS7.5 使用 asmx 的简单 helloworld WebService 在 Windows 2008 R2 IIS 7.5 上发布时不起作用 - Simple helloworld WebService using asmx not working when published on Windows 2008 R2 IIS 7.5 偏移 sql 和 EF 在 IIS 7.5 中与 win server 2008 R2 不兼容 - OFFSET sql and EF Skip no compatibility in IIS 7.5 with win server 2008 R2 在IIS7.5上承载WCF服务,收到404.0错误 - Hosting WCF service on IIS7.5, receiving 404.0 error IIS7.5中的请求实体太大-WCF服务 - Request Entity Too large in IIS7.5 - WCF Service 在Live Server(Windows Server 2008 R2企业)中,无法使用wkhtmltopdf.exe生成PDF,但可以在本地主机中使用 - In Live Server (Windows server 2008 R2 enterprise) PDF Is Not Generating with wkhtmltopdf.exe, but works in Local Host 显示Windows Server 2008 R2 - display windows server 2008 R2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM