SecurityBindingElement.CreateUserNameOverTransportBindingElement() not supported.
See original GitHub issuepossibly related to #9 but I wasn’t sure so I’m opening this because I wasn’t sure what the roadmap was.
I get this error when trying to use the SecurityBindingElement.CreateUserNameOverTransportBindingElement(); binding element as part of a CustomBinding
(running on OSX with .NET core RC2)
Here is my code
public class AcmeServiceChannelFactory : ChannelFactory<AcmeService>
{
public AcmeServiceChannelFactory()
: base(CreateDefaultBinding(), new EndpointAddress("https://acme.com/service.asmx"))
{
Credentials.UserName.UserName = "username";
Credentials.UserName.Password = "password";
}
internal static Binding CreateDefaultBinding()
{
var binding = new CustomBinding();
var securityBinding = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
securityBinding.IncludeTimestamp = false;
securityBinding.SecurityHeaderLayout = SecurityHeaderLayout.Lax;
binding.Elements.Add(securityBinding);
var textbinding = new TextMessageEncodingBindingElement
{
MessageVersion = MessageVersion.Soap11,
ReaderQuotas = new XmlDictionaryReaderQuotas
{
MaxArrayLength = int.MaxValue,
MaxDepth = 64,
MaxStringContentLength = int.MaxValue
}
};
binding.Elements.Add(textbinding);
var httpsBinding = new HttpsTransportBindingElement
{
MaxReceivedMessageSize = int.MaxValue,
MaxBufferSize = int.MaxValue
};
binding.Elements.Add(httpsBinding);
binding.OpenTimeout =
binding.ReceiveTimeout =
binding.SendTimeout = TimeSpan.FromMinutes(5);
return binding;
}
}
error:
System.PlatformNotSupportedException: TransportSecurityBindingElement.BuildChannelFactoryCore is not supported.
at System.ServiceModel.Channels.TransportSecurityBindingElement.BuildChannelFactoryCore[TChannel](BindingContext context)
at System.ServiceModel.Channels.Binding.BuildChannelFactory[TChannel](BindingParameterCollection parameters)
at System.ServiceModel.Channels.ServiceChannelFactory.BuildChannelFactory(ServiceEndpoint serviceEndpoint, Boolean useActiveAutoClose)
at System.ServiceModel.ChannelFactory.OnOpening()
at System.ServiceModel.Channels.CommunicationObject.<System-ServiceModel-IAsyncCommunicationObject-OpenAsync>d__71.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.Channels.CommunicationObject.<OpenAsyncInternal>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.ServiceModel.ChannelFactory.EnsureOpened()
at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
Issue Analytics
- State:
- Created 7 years ago
- Comments:30 (15 by maintainers)
Top Results From Across the Web
How to: Create a SecurityBindingElement for a Specified ...
You can create security binding elements for these authentication modes by using static methods on the SecurityBindingElement class or ...
Read more >WCF - how to create programatically custom binding with ...
Try SecurityBindingElement.CreateUserNameOverTransportBindingElement() instead: var custBinding = new CustomBinding(); custBinding.Elements.
Read more >SOAP API Implementation using .NET CORE
SecurityBindingElement.CreateUserNameOverTransportBindingElement() ... BuildChannelFactoryCore is not supported.
Read more >MessageSecurityOverTcp.cs source code in C# .NET
CreateUserNameOverTransportBindingElement (); break; case MessageCredentialType. ... IssuedToken; } else { // the standard binding does not support None ...
Read more >BasicHttpBinding internals - Damir Dobric Posts
If none of these modes is set, the SecurityBindingElement will not be created at all. ... SecurityBindingElement.CreateUserNameOverTransportBindingElement().
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I would like to know when WS-trust bindings will be supported for .NET Core
I am curious on the progress of the restore. Thanks