WCF 服务 - MTOM 安全模式和 transport/message 属性 的值

WCF Service - MTOM Security modes & transport/message property's values

能否请您告诉我,how/what 在 MTOM-basicHttpBinding 的配置中设置模式和 ClientCredentialType 属性。

对于ANONYMOUS 身份验证- 以下配置工作正常

<security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
</security>

能否请您帮助我了解 NTLM 和 Windows 身份验证类型的每个属性的值应该是什么 Mtom绑定?

谢谢,

以下两种安全模式都支持Windows/NTLM身份验证和MTOM编码。

Uri uri = new Uri("https://localhost:21011");
  BasicHttpBinding binding = new BasicHttpBinding();
            binding.MessageEncoding = WSMessageEncoding.Mtom;
            binding.Security.Mode = BasicHttpSecurityMode.Transport;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
            // NTLM
            //binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;

或者,

Uri uri = new Uri("http://localhost:21011");
            BasicHttpBinding binding = new BasicHttpBinding();
            binding.MessageEncoding = WSMessageEncoding.Mtom;
            binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;

如果问题仍然存在,请随时告诉我。