You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defining a WCF Core service using WSHttpBinding with SecurityMode.TransportWithMessageCredential. Creating a client using .NET Framework, will correctly be able to call the service.
The generated code for a .NET core client does not, and fails.
The service endpoint is defined using:
publicvoidConfigure(IApplicationBuilderapp){varwsHttpBindingWithCredential=new WSHttpBinding(SecurityMode.TransportWithMessageCredential);
wsHttpBindingWithCredential.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
app.UseServiceModel(builder =>{// Add the Echo Service builder.AddService<EchoService>(serviceOptions =>{// Set a base address for all bindings to the service, and WSDL discovery serviceOptions.BaseAddresses.Add(new Uri($"http://localhost:{Program.HTTP_PORT}/EchoService")); serviceOptions.BaseAddresses.Add(new Uri($"https://localhost:{Program.HTTPS_PORT}/EchoService"));})// Add WSHttpBinding endpoints.AddServiceEndpoint<EchoService,IEchoService>(new WSHttpBinding(SecurityMode.None),"/wsHttp").AddServiceEndpoint<EchoService,IEchoService>(new WSHttpBinding(SecurityMode.Transport),"/wsHttp").AddServiceEndpoint<EchoService,IEchoService>(wsHttpBindingWithCredential,"/wsHttpUserPassword",ep =>{ ep.Name ="AuthenticatedEP";}); builder.ConfigureServiceHostBase<EchoService>(CustomUserNamePasswordValidator.AddToHost);// Configure WSDL to be available over http & httpsvarserviceMetadataBehavior= app.ApplicationServices.GetRequiredService<CoreWCF.Description.ServiceMetadataBehavior>(); serviceMetadataBehavior.HttpGetEnabled = serviceMetadataBehavior.HttpsGetEnabled =true;});}
The GetBindingForEndpoint generated code for the service definition is:
I have the same problem. Instead of CreateCertificateOverTransportBindingElement the client binding is generated with CreateUserNameOverTransportBindingElement.
Defining a WCF Core service using WSHttpBinding with SecurityMode.TransportWithMessageCredential. Creating a client using .NET Framework, will correctly be able to call the service.
The generated code for a .NET core client does not, and fails.
The service endpoint is defined using:
The
GetBindingForEndpoint
generated code for the service definition is:Which is incorrectly trying to use CreateUserNameOverTransportBindingElement(); which is incorrect for this binding type.
The text was updated successfully, but these errors were encountered: