"Asynchronous" server does not affect the "asynchronous" client. For example, in a project that I'm working on right now, I have on a server
[ServiceContract(Namespace = "http://example.com/Example/v1", ProtectionLevel = ProtectionLevel.EncryptAndSign)]
public interface IClientsUploader
{
[OperationContract()]
Task<Results> UploadClientsAsync(Database database, Client[] clients);
}
but on the client side I have a contract
[System.ServiceModel.ServiceContractAttribute(Namespace="http://example.com/Example/v1", ConfigurationName="Example.IClientsUploader")]
public interface IClientsUploader
{
[System.ServiceModel.OperationContractAttribute(Action="http://example.com/Example/v1/IClientsUploader/UploadClients", ReplyAction="http://example.com/Example/v1/IClientUploader/UploadClientsResponse")]
Example.DataStructures.Results UploadClients(Example.DataStructures.Database database, System.Collections.Generic.IEnumerable<Example.DataStructures.Client> clients);
}
And it works great. WCF notice template Task XxxxAsyncand converts it to the end point with no return type Task<T>and a suffix Async. However, when an operation is performed in an operation, it can be handled with the help of things like await.
source
share