dotnet / dotnet/wcf

WS Message mode not supported

Open
#5,370 4 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
1.8k
Forks
576
Avg merge
6d 9h
Merged PRs (30d)
2

Description

When dispatching client with `WSHttpBinding` and `SecurityMode.Message` the `CreateSecurityBindingElement` method from `System.ServiceModel.MessageSecurityOverHttp` will throw platform not supported error.

My old .NET Framework 4.8 project is using the following configuration.

```xml












```

I've recreated it in .NET 7.0 manually as followed
```C#
// Initialize the default binding
var wsHttpBinding = new WSHttpBinding();
wsHttpBinding.CloseTimeout = TimeSpan.Parse("23:59:59");
wsHttpBinding.OpenTimeout = TimeSpan.Parse("23:59:59");
wsHttpBinding.ReceiveTimeout = TimeSpan.Parse("23:59:59");
wsHttpBinding.SendTimeout = TimeSpan.Parse("23:59:59");
wsHttpBinding.MaxBufferPoolSize = 524288;
wsHttpBinding.MaxReceivedMessageSize = 1073741824;

// Set reader quotas
wsHttpBinding.ReaderQuotas.MaxDepth = 1000000000;
wsHttpBinding.ReaderQuotas.MaxStringContentLength = 1000000000;
wsHttpBinding.ReaderQuotas.MaxArrayLength = 1000000000;
wsHttpBinding.ReaderQuotas.MaxBytesPerRead = 1000000000;
wsHttpBinding.ReaderQuotas.MaxNameTableCharCount = 1000000000;

wsHttpBinding.Security.Mode = SecurityMode.Message;
wsHttpBinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;

// Initialize the default endpoint address
Address = new EndpointAddress(new Uri("http://localhost:2000/Service"));
```

Is this method not supported in .NET 7.0 or is there a workaround.

Contributor guide

Open the contributing guide

Research direction

Start at System.ServiceModel.MessageSecurityOverHttp.CreateSecurityBindingElement and trace the WSHttpBinding security setup for SecurityMode.Message with UserName credentials. Confirm whether .NET 7 supports this path using the supplied configuration and reproduction, then document a supported workaround or the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.