联合WCF ..验证消息的安全性时发生错误

时间:2020-07-10 10:17:08

标签: wcf asp.net-core

我正在尝试使用dotnet/wcf调用WCF SOAP服务,但出现异常

An error occurred when verifying security for the message. 

WCF服务正在使用联合身份验证,并且通过以下方式配置了呼叫的自定义绑定:

            var binding = new CustomBinding
            {
                Elements = { new HttpsTransportBindingElement 
                {
                    MaxBufferSize = int.MaxValue,
                    MaxReceivedMessageSize = int.MaxValue,
                    AuthenticationScheme = AuthenticationSchemes.Negotiate
                }}
            };

            var client = new ServiceClient(binding, new EndpointAddress("https://SERVER/Service.svc?wsdl"));
            client.ClientCredentials.UserName.UserName = "USERNAME";
            client.ClientCredentials.UserName.Password = "PASS";
            var result= client.TestMethodAsync(new TestMethodQuery(){
                Param1 = "Value1"
            }).Result;

有什么建议与联合WCF服务一起使用时如何配置绑定?

更新..似乎尚不支持此功能:https://github.com/dotnet/wcf/issues/31

0 个答案:

没有答案