Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf 无法在服务器IE浏览器中查看服务_Wcf_Iis 7.5_Windows Server 2008 - Fatal编程技术网

Wcf 无法在服务器IE浏览器中查看服务

Wcf 无法在服务器IE浏览器中查看服务,wcf,iis-7.5,windows-server-2008,Wcf,Iis 7.5,Windows Server 2008,我有一个带有net.tcp和http服务器绑定的WCF服务 Web.config文件如下所示 <system.web> <compilation debug="false" targetFramework="4.0" /> </system.web> <system.serviceModel> <bindings> <netTcpBinding> <binding

我有一个带有net.tcp和http服务器绑定的WCF服务

Web.config文件如下所示

 <system.web>
    <compilation debug="false" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="tcp_Unsecured" portSharingEnabled="true">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service name="MarketFeedServiceLibrary.Service1">
        <endpoint address="net.tcp://localhost:808/MarketFeedService/Service.svc/mexTcp"
          binding="mexTcpBinding" bindingConfiguration="" name="mexEndPoint"
          contract="IMetadataExchange" />
        <endpoint address="net.tcp://localhost:808/MarketFeedService/Service.svc/tcpService"
          binding="netTcpBinding" bindingConfiguration="tcp_Unsecured"
          name="dataEndPoint" contract="MarketFeedServiceLibrary.IService1" />
        <endpoint address="http://localhost:80/MarketFeedService/Service.svc/basicHttp"
          binding="basicHttpBinding" bindingConfiguration="" name="httpDataEndpoint"
          contract="MarketFeedServiceLibrary.IService1" />
        <endpoint address="http://localhost:80/MarketFeedService/Service.svc/mex"
          binding="mexHttpBinding" bindingConfiguration="" name="httpMexEndpoint"
          contract="MarketFeedServiceLibrary.IService1" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
       />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

如果我使用该地址在IE中浏览,我已在本地PC的IIS中托管该服务
”http://localhost/MarketFeedService/Service.svc“
,我得到的元数据信息如下

但是,如果我在VPS服务器(Windows Server 2008 IIS 7.5)上的IIS中使用相同的地址承载相同的WCF Web服务,则会出现以下错误:

我还可以添加本地托管服务的服务引用,但如果我尝试添加路径为“net”的服务器的服务引用。tcp://IPAddress/MarketFeedService/Service.svc,我得到以下错误

无法调度该消息,因为终结点地址“net”处的服务已停止。tcp://IPAddress/MarketFeedService/Service.svc'对于地址的协议不可用。

N.B.

  • Net.Tcp端口共享服务、Net.Tcp侦听器适配器已打开
  • 已安装并启用WCF Http和非Http激活
  • 默认网站和应用程序都启用了http和net.tcp协议

  • 非常感谢。svc文件类型在IIS中是否正确映射?

    对于那些有可能或可能与此问题不完全匹配的问题的人,这只是另一个选择(由于防火墙,我无法查看工作中发布的快照)——

    我遇到了很多问题,尤其是RESTful服务在本地运行正常,但在服务器上崩溃并烧坏了。我认为这可能是因为根配置或注册表的配置冲突,但事实并非如此

    您必须进入IIS并查看您的基本站点级设置,将有一个名为“ISAPI过滤器”的功能选项

    长话短说,称为UrlScan的特定ISAPI过滤器(版本可能非常多,我认为当前版本是3.1)是我们问题的根源。这个过滤器的作用是寻找传入请求的模式,以尝试筛选出潜在的恶意请求

    随着技术的变化和改进,安装程序不熟悉的请求将被拒绝或重新路由。在我的例子中,它是在查看文件扩展名。从ASP扩展启动的较旧SOAP技术已被识别/批准(.asmx),但我们从未设置RESTful或WCF服务,因此它无法识别“.svc”扩展

    初始设置通常非常紧凑,任何http请求都会被拒绝或重新路由,管理web服务器的人都会根据需要调整文件以实现功能

    您可以转到文件位置,在同一目录中是带有该工具设置的.ini文件

    在该文本文件中,查找名为[AllowExtensions]和[DenyExtensions]的部分。确保将.svc添加到“允许”组中,并确保它没有显式地列在拒绝组中


    事件日志是否向您提供了任何信息?您是指事件日志查看器还是错误页面上提到的跟踪日志。跟踪日志文件夹为空,未记录任何内容!是的,我通过了链接,所有的设置都是按照该链接完成的。好的,那么你已经运行了:aspnet_regiis.exe-I for.NET 4.0?这是您在上面发布的完整web.config吗?您在IIS中运行应用程序的托管管道模式是什么?是否使用任何http模块或扩展?我运行了aspnet_regiis.exe,但它已经运行了,但我检查了默认网站的处理程序映射,它显示*.svc映射到aspnet。集成了托管管道模式。我正在经历与我的错误有关的事情。