IIS中的主机网站具有WCF服务

时间:2015-10-08 07:06:51

标签: c# asp.net-mvc web-services wcf iis

我有一个包含一个WCF服务的网站。我没有单独的WCF项目。在本地工作时,它工作正常。现在我想在IIS中托管该网站它显示404(未找到)

  

http://arapl-ws-08/ARAPLWeb/wcf/ExposureService.svc/InitializeGrid 404(未找到)

这是托管网站后的文件夹结构 enter image description here

web.config中的

我已经提到了像这样的服务模型

<system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="WebHttpEndpointBinding">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" proxyCredentialType="Windows" />
            <!--<transport clientCredentialType="Windows"  />-->
          </security>
        </binding>
      </webHttpBinding>
    </bindings>

    <behaviors>
      <endpointBehaviors>
        <behavior name="ARAPL">
          <endpointDiscovery enabled="false" />
          <enableWebScript />
        </behavior>
      </endpointBehaviors>

      <serviceBehaviors>
        <behavior name="WCFWindowsBasicHttpBinding.Service1Behavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceAuthenticationManager authenticationSchemes="Negotiate" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>

      <service name="RiskAnalytics.Web.wcf.ExposureService" behaviorConfiguration="WCFWindowsBasicHttpBinding.Service1Behavior">
        <endpoint address="" name="webHttpEndpoint" binding="webHttpBinding" bindingConfiguration="WebHttpEndpointBinding" behaviorConfiguration="ARAPL" contract="RiskAnalytics.Web.wcf.IExposureService">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>

    </services>
  </system.serviceModel>

1 个答案:

答案 0 :(得分:0)

  这解决了我的问题。如果有人有问题,请参阅此

我在博客文章中发现了这些说明,表明这一步对我有用(Windows 8,64位):

确保在Windows功能中,您在.Net框架下有两个WCF选项。

  

所以转到控制面板 - &gt;程序和功能 - &gt;转动Windows   功能开/关 - &gt;特点 - &gt;添加功能 - &gt; .NET Framework X.X   特征。确保.Net框架说它已安装并生成   确保选中它下面的WCF激活节点(复选框   勾选)并且还会检查WCF激活下的两个选项。

这些是:

* HTTP Activation
* Non-HTTP Activation

需要选择两个选项(勾选复选框)。