I am trying to create a WCF service that supports asynchronous calls. I followed all the samples and tutorials that I could find, and they all have the usual scheme of one synchronous method and asynchronous start and end, for example:
[OperationContract(AsyncPattern = false)] string GetData(int value); [OperationContract(AsyncPattern = true)] IAsyncResult BeginGetData(int value, AsyncCallback callback, object asyncState); string EndGetData(IAsyncResult result);
However, only synchronous GetData is called, regardless of what I do on the client side. Fiddler tells me that the message is always the same:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><GetData xmlns="http://tempuri.org/"><value>0</value></GetData></s:Body></s:Envelope>
When I remove the synchronous GetData interface, the async method is now called correctly.
Is this normal behavior? Is there anything else I have to do to support synchronous and asynchronous versions of the method?
source share