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



是否有可能在同一服务上有两个端点使用不同的身份验证方法?为什么我不能使用 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/

10-16 13:57
查看更多