繁体   English   中英

在具有WCF服务的IIS中托管网站

[英]Host Website in IIS having WCF Service

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

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

这是托管网站后的文件夹结构 在此处输入图片说明

在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>

这解决了我的问题。 如果有人遇到问题,请参考这里

我在指示该步骤的博客文章中找到了这些说明,该说明对我有用(Windows 8,64位):

确保在Windows功能中,.Net framework下的两个WCF选项都被打勾。

因此,请转到控制面板–>程序和功能–>打开/关闭Windows功能–>功能–>添加功能–> .NET Framework XX功能。 确保.Net framework表示已安装,并确保选中了其下方的WCF Activation节点(勾选了此复选框),并且还选中了WCF Activation下的两个选项。

这些是:

* HTTP Activation
* Non-HTTP Activation

这两个选项都需要选中(选中复选框)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM