I dispose a WCF Service Implemented with WCF 4.6.1 Framework containing an Endpoint binded with WS2007HttpBinding. My purpose is to implement a .NET Core client Side application that calls this service. When i tried to use CustomBinding, it generates this error :
System.InvalidOperationException : 'The CustomBinding on the ServiceEndpoint with contract 'IWSTrust13Sync' lacks a TransportBindingElement. Every binding must have at least one binding element that derives from TransportBindingElement.'
public class Program
{
public static void Main(string[] args)
{
Message requestmessage = Message.CreateMessage(
MessageVersion.Soap12WSAddressing10,
"http://test/test",
"This is the body data");
var binding = new CustomBinding();
var endpoint = new EndpointAddress(new Uri("http://servicetest.service.svc"));
var channelFactory = new ChannelFactory<ServiceSTS.IWSTrust13Sync>(binding, endpoint);
var serviceClient = channelFactory.CreateChannel();
var result = serviceClient.Trust13ValidateAsync(requestmessage);
channelFactory.Close();
Console.WriteLine(result.Status);
}
}
Is there a replacement of WS2007HttpBinding in .NET Core ?
Notice that i should not change any things in the service because it is in use by other applications