WCF服务主机未连接到测试客户端

时间:2012-10-25 14:52:03

标签: wcf web-services c#-4.0

我下载了MS WCF示例,并在我的本地计算机上进行了一次设置并运行正常。我让本地网络上的其他人运行我的client.exe,它也运行良好。

现在我正在尝试使用相同的服务并将其应用到同一本地网络上的最终主页,但是在我们的Web服务器上。服务器为我们提供了多个网页,我们将把它用于使用WCF服务的“新”即将到来的应用程序。

我已经扫描了stackoverflow并且学到了很多但是没有找到我所缺少的东西,我认为这很简单。

当使用我的本地wcftestclient时,我可以添加我本地托管的svc,但是当我只是通过复制/粘贴来更改具有完全相同的svc文件的主机的IP时,我得到以下一般错误。< / p>

Error: Cannot obtain Metadata from http://192.168.1.17/gps.mySite.com/servicemodelsamples/service.svc?wsdl If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://192.168.1.17/gps.mySite.com/servicemodelsamples/service.svc?wsdl    Metadata contains a reference that cannot be resolved: 'http://192.168.1.17/gps.mySite.com/servicemodelsamples/service.svc?wsdl'.    An error occurred while receiving the HTTP response to http://192.168.1.17/gps.mySite.com/servicemodelsamples/service.svc?wsdl. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.    The underlying connection was closed: An unexpected error occurred on a receive.    Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.    An existing connection was forcibly closed by the remote hostHTTP GET Error    URI: http://192.168.1.17/gps.mySite.com/servicemodelsamples/service.svc?wsdl    There was an error downloading 'http://192.168.1.17/gps.mySite.com/servicemodelsamples/service.svc?wsdl'.    The underlying connection was closed: An unexpected error occurred on a receive.    Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.    An existing connection was forcibly closed by the remote host

我让管理员完成了以下任务,希望它能够根据以下链接解决我们的问题:Script not served by static file handler

我认为这些帮助我完成了本地服务,但没有在远程服务器上工作。

的Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="Microsoft.Samples.GettingStarted.CalculatorService" behaviorConfiguration="MetadataBehavior">
        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="Microsoft.Samples.GettingStarted.ICalculator" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MetadataBehavior">
          <serviceDebug includeExceptionDetailInFaults="True" httpHelpPageEnabled="True" />
          <serviceMetadata httpGetEnabled="True"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

本地主机(工作): 7终极 IIS 7.5 .NET 4.0

远程主机(不工作): 2008 R2 IIS 7.5 .NET 4.0

其他想法......是否有可能需要在托管服务器上打开的端口?一旦我们尝试通过网络本身访问此问题,是否会有其他问题/更改?

C#&amp; WCF对我来说都是新手,所以请自由地解释一个5岁的孩子会理解的方式。 :) TIA

0 个答案:

没有答案