gpt4 book ai didi

WCF Streaming on service with Windows Authentication Endpoint

转载 作者:行者123 更新时间:2023-12-01 06:43:16 25 4
gpt4 key购买 nike

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

 <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 端点的安全元素,但仍然收到以下错误:

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



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

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

Which authentication mode of basichhtpbinding can be used to secure a WCF Service using Streaming?

最佳答案

不幸的是,这不受支持。

关于WCF Streaming on service with Windows Authentication Endpoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8173834/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com