【问题标题】:Integrated Windows Authentication WCF Multiple Host Headers IIS 6 not working集成 Windows 身份验证 WCF 多主机头 IIS 6 不工作
【发布时间】:2010-10-11 18:35:14
【问题描述】:

我有一个 asp.net 2.0 网站,其中托管了 WCF 服务,在 .NET 3.5 框架上运行。该网站仅使用集成 Windows 身份验证进行设置。 Web 服务器是 IIS 6,在 Windows 2003 Sp2(2 个服务器)上具有负载平衡。我无法使用完整的 url (http://myqa2.abcdefg.com/trxn/WCFTrxnService.svc) 访问 WCF 服务 (.svc)。另请注意,服务器配置有多个主机标头。该网站受 siteminder 保护。最初我遇到了一个错误

此集合已包含一个采用 http 方案的地址。此集合中的每个方案最多可以有一个地址。参数名称:项目

所以添加了以下配置条目

<serviceHostingEnvironment>
  <baseAddressPrefixFilters>
    <clear/>
    <add prefix="http://myqa2.abcdefg.com"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

该错误消失了,但现在浏览器提示我登录。对于同一个网站,我可以访问 .aspx 页面。登录提示仅针对 .svc 文件显示。

这是我正在使用的配置文件中的绑定/端点。

<system.serviceModel>
<serviceHostingEnvironment>
  <baseAddressPrefixFilters>
    <clear/>
    <add prefix="http://myqa2.abcdefg.com"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
  <basicHttpBinding>
    <binding name="IISIntegratedAuthBinding">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Windows"/>
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="TestWCFFromSL.Web.WCFTrxnServiceBehavior">
      <serviceMetadata httpGetEnabled="true" httpGetUrl="http://myqa2.abcdefg.com/fmc/WCFNotesService.svc"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service name="TestWCFFromSL.Web.WCFTrxnService" behaviorConfiguration="TestWCFFromSL.Web.WCFTrxnServiceBehavior">
    <endpoint
      address="http://myqa2.abcdefg.com/trxn/WCFTrxnService.svc"
      binding="basicHttpBinding"
      bindingConfiguration="IISIntegratedAuthBinding"
      contract="TestWCFFromSL.Web.IWCFTrxnService" />
  </service>
</services>
<!--<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>-->

【问题讨论】:

    标签: wcf internet-explorer authentication iis-6


    【解决方案1】:

    如果网站受 SiteMinder 保护,WCF / SOAP 调用将不起作用。但是这个问题的不同解决方案正在奏效。

    网址 myqa2.abcdefg.com/trxn/WCFTrxnService.svc 受 SiteMinder 保护,但 myqa2/trxn/WCFTrxnService.svc 不受 siteminder 保护,看起来 SiteMinder 只保护 FQDN(完全合格的域名)。所以我将应用程序配置为使用短 url 而不是 FQDN 调用 WCF 服务。我还必须使用 crossdomainpolicy,因为应用程序将 myqa2.abcdefg.com 和 myqa2 视为 2 个单独的域。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-22
      • 2010-09-05
      • 1970-01-01
      • 2010-11-03
      相关资源
      最近更新 更多