在App托管的WCF服务中,当反向代理时抛出404

时间:2017-12-06 07:34:12

标签: c# wcf iis proxy reverse-proxy

我有MVC应用程序,我也有WCF服务。它托管在IIS中。当我尝试访问站点和WCF服务时,我可以成功运行该服务。但是当我通过反向代理访问该站点时,我无法访问WCF服务,但它会抛出404错误。我已将InBoundRule模式提供为(.*)。对此问题的任何帮助都将受到高度赞赏。

修改

<system.serviceModel>
<services>
  <service name="OLAP.wcf.OlapClientService" behaviorConfiguration="MyServiceBehavior">
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="WebBindingHttp" contract="OLAP.wcf.IOlapClientService" behaviorConfiguration="WebBehavior">
    </endpoint>
    <!--<endpoint address=""
                      binding="webHttpBinding"
                      bindingConfiguration="WebBindingHttps"
                      contract="OLAP.wcf.IOlapClientService" behaviorConfiguration="WebBehavior">
    </endpoint>-->
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="WebBehavior">
      <webHttp />
    </behavior>
  </endpointBehaviors>
</behaviors>
<bindings>
  <webHttpBinding>
    <binding name="WebBindingHttp">
      <security mode="None">
        <transport clientCredentialType="None" />
      </security>
    </binding>
    <binding name="WebBindingHttps">
      <security mode="Transport">
        <transport clientCredentialType="None" />
      </security>
    </binding>
  </webHttpBinding>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService1" />
  </basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
<client>
<endpoint address="http://100.100.100.100:8082/VibrantWS.svc/soap" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
</client>

0 个答案:

没有答案