netstandard 2.0 - support for TransportWithMessageCredential in BasicHttpsBinding
See original GitHub issueHello, question especially to @mconnew or anyone. I want to ensure that we have support for TransportWithMessageCredential in BasicHttpsBinding (not BasicHttpBinding) in netstandard 2.0.
In this site we can see support for BasicHttpBinding, but I’m guess that we have support also for BasicHttpsBinding. https://github.com/dotnet/wcf/blob/master/release-notes/SupportedFeatures-v2.0.0.md
This code throws NotSupportedPlatformException:
var binding = new BasicHttpsBinding(BasicHttpsSecurityMode.TransportWithMessageCredential)
{
};
but this code below doesn’t throw exception and looks like everything works. I’m not sure if everything is secured/implemented under hood:
var binding = new BasicHttpsBinding
{
Security =
{
Mode = BasicHttpsSecurityMode.TransportWithMessageCredential
}
};
This is reference to your source code: https://github.com/dotnet/wcf/blob/release/2.0.0/src/System.Private.ServiceModel/src/System/ServiceModel/BasicHttpsBinding.cs
This is some kind of bug in this code and I can use this code OR BasicHttpsBinding is only partially/not supported? I tried upgrade netstandard 2.0 to netstandard 2.1 but it looks like doesn’t help. Upgrade for my case is generally not a good idea because it’s a big cost.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:15 (6 by maintainers)
@imcarolwang could you please take a look and see if you could fix this? In the meantime, we probably should also looking into add test coverage to this (copy the existing test for BasicHttpBinding)
@fptkolodziejczyk, in regard to Re.2, I don’t have enough information to say what’s going on. The server is returning a 503 error, so there’s something the server didn’t like about the request. You would need to contact the service owner to get assistance debugging tha. If the service is running WCF, you can also use
svc?SingleWsdl
in a browser and save the file to disk. Then you can point all the tooling such as svcutil to the save file. If it isn’t WCF and can’t use theSingleWsdl
option, you can download the base wsdl, then examine it in a text editor and find all the imports specified, then go and download each of the imports. You might need to fix up the import statements in the wsdl if they are absolute paths, but once you’ve done that, then you can point the code generation tooling at the downloaded files. It’s less than ideal, but without knowing the root cause, it’s the only suggestion I have.As for CustomBinding with an endpoint configuration name, that’s because we can’t support app.config in .NET Core as we rely heavily on a lot of stuff in the machine.config file. You need to configure your CustomBinding in code. If you are having difficulty translating your app.config configuration into the code equivalent, you can provide your config here and I can help you convert it.