How do I configure wsHttpBinding with .NET core, Should I configure in Project.json file ? Before .NET Core the configuration is like below
It should be as simple as the following:
ChannelFactory factory = null;
IGetPeopleService serviceProxy = null;
Binding binding = null;
binding = new WsHttpBinding(SecurityMode.None);
factory = new ChannelFactory(binding, new EndpointAddress("http://localhost/people.svc"));
serviceProxy = factory.CreateChannel();
var result = serviceProxy.GetPeopleData(100);
Baically, swap BasicHttpBinding
for WsHttpBinding
.
ADDED Information
Taken from this answer:
You need to add a reference to System.ServiceModel
in your project.json, like this:
{
"commands": {
"run": "run"
},
"frameworks": {
"dnx451": {
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta2"
},
"frameworkAssemblies": {
"System.ServiceModel": "4.0.0.0"
}
}
}
}
Note this answer was for ASP.NET 5 Pre-Release.