I have a client/server application and i'm removing the Service Reference from the client side. I've followed this article to be able to achieve accessing server functions without it. This works fine.
The problem i'm having is that the service reference was able to generate sync/async versions of the functions (of which we were using the async version) whereas accessing the functions directly through the Interface we only have access to the sync version. Is there a way to asynchronously call wcf service functions without the service reference? Is the only way to do this to have a wrapper that creates a Task
every time i want to make the call?
here is the code snippet for accessing the service functions:
ChannelFactory<IService> channelFactory = null;
EndpointAddress endpointAddress = new EndpointAddress("http://localhost:4504" + "/MyService");
channelFactory = new ChannelFactory<IService >(binding, endpointAddress);
IService channel = channelFactory.CreateChannel();
var result = channel.MyFunction();
What i want is to be able to do var result = channel.MyFunctionAsync();
I've also looked at this answer, but that would involve creating delegates for every function in our Interface which has hundreds of functions