I'm pretty new to WCF, so I might be missing something, but what is my question:
I have a WCF service to connect my two apps. One of the app (it is windows service) connects to external server, so I have asynchronous web requests in code. I wanted to do it in following way: I created callback interface with authorization method:
public interface ICommunicationServiceCallback
{
[OperationContract(IsOneWay = true)]
Task OnAuthorizeAsync(
string username,
string password,
string proxyUrl = null,
string proxyUsername = null,
string proxyPassword = null);
}
And then I added service reference to my WS code. But instead if Task OnAuthorizeAsync
method it generates void OnAuthorize
method, so only way to make it work is having async void OnAuthorize
method in implementation, which is bad.
How can I achieve my goal?