WCF (SOAP): Asynchronous Service Operations

When using WCF SOAP Services, visual studio automatically creates both synchronous and asynchronous versions of methods on the server, in the client's client application. For example, this non-asynchronous method on the server:

public Data GetData(){
 return data;
} 

      

can be used as

var i = client.GetData();

      

or

var i = await client.GetDataAsync();

      

Now my question is, would it be useful to use server side asynchronous service methods in general? I mean, when using async service contract methods, will there be any server side performance gain at all or not?

+3


source to share


1 answer


... if using the async service contract methods, will there be any server-side performance gain at all or not?

There is no difference on the server side. Asynchronous service operations on the client are purely client-side implementation. Incoming calls will be indistinguishable from the service.

Do you think the IDisposable implementation for the service will be beneficial or not



If you are talking about service code, you are either using a container ServiceHost

to start your service, which already implements IDisposable, or it will be dynamically loaded from IIS or WAS, in which case you have no control over the correct seed to implement IDisposable.

If your internal service code uses unmanaged resources at runtime, you need to manage the disposal of these things, but this is .NET 101 and is true for anything that isn't just WCF.

+2


source







All Articles