最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

SoapCore 1.2 Custom BInding - Stack Overflow

programmeradmin2浏览0评论

I just upgraded to the latest version 1.2.1.2, and the Binding property has now been removed. Does anyone know how we're supposed to configure a custom binding now? I was using it for TransportWIthMessageCredential security, and SOAP 1.2.

wsHttpBinding.Security.Mode = SecurityMode.TransportWithMessageCredential;
wsHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
wsHttpBinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;

var binding = new CustomBinding(wsHttpBinding);
MessageEncodingBindingElement encodingElement = binding.Elements.Find<MessageEncodingBindingElement>();
encodingElement.MessageVersion = MessageVersion.Soap12WSAddressing10;

app.UseSoapEndpoint<IServiceHost>(soap =>
{
    soap.Path = "my url";
    soap.Binding = binding;
    soap.SoapSerializer = SoapSerializer.XmlSerializer;
    soap.CaseInsensitivePath = true;                    
});   
发布评论

评论列表(0)

  1. 暂无评论