WCF Streaming on service with Windows Authentication Endpoint [英] WCF Streaming on service with Windows Authentication Endpoint

查看:24
本文介绍了WCF Streaming on service with Windows Authentication Endpoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 WCF 服务,它有两个端点,由下面的配置文件定义:

I have a WCF service with two endpoints defined by the configuration file below:

 <system.serviceModel>
        <services>
          <service name="SyncService" behaviorConfiguration="SyncServiceBehavior">
            <endpoint name="Data" address="Data" binding="basicHttpBinding" bindingConfiguration="windowsAuthentication" contract="ISyncService"/>
            <endpoint name="File" address="File" binding="basicHttpBinding" bindingConfiguration="httpLargeMessageStream" contract="ISyncService"/>
            <endpoint address="mex" binding="webHttpBinding" bindingConfiguration="windowsAuthentication" contract="IMetadataExchange"/>
          </service>
        </services>
        <bindings>
          <basicHttpBinding>
            <binding name="httpLargeMessageStream" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed" messageEncoding="Mtom" />
            <binding name="windowsAuthentication" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""></transport>
                <message algorithmSuite="Default" clientCredentialType="UserName"/>
              </security>
            </binding>
          </basicHttpBinding>
          <webHttpBinding>
            <binding name="windowsAuthentication">
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows"></transport>
              </security>
            </binding>
          </webHttpBinding>
      </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="SyncServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"></serviceHostingEnvironment>
      </system.serviceModel>

我想对数据端点使用 Windows 身份验证,但最近发现您无法使用 Windows 身份验证通过 HTTP 进行流式传输.我删除了 File 端点的安全元素,但仍然收到以下错误:

I want to use windows authentication for the Data endpoint, but have recently discovered that you cannot use windows authentication for streaming over HTTP. I removed the security element for the File endpoint, but still get the following error:

HTTP 请求流不能与 HTTP 结合使用验证.禁用请求流或指定匿名HTTP 身份验证.参数名称:bindingElement

HTTP request streaming cannot be used in conjunction with HTTP authentication. Either disable request streaming or specify anonymous HTTP authentication. Parameter name: bindingElement

是否可以在同一服务上让两个端点使用不同的身份验证方法?为什么我不能使用 Windows 身份验证进行流式传输?

Is it possible to have two endpoints on the same service use different authentication methods like this? Why can't I use windows authentication for streaming?

我也尝试过这个帖子中的建议,但无济于事:

I have also tried what was suggested in this thread, but to no avail:

哪种认证模式可以使用basichhtpbinding 来保护使用Streaming 的WCF 服务吗?

推荐答案

不幸的是,这不受支持.

Unfortunately this is not supported.

这篇关于WCF Streaming on service with Windows Authentication Endpoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆