Reputation: 769
I am implementing Asynchronous nature on server and client side. Created the WCF service (Hosted as Windows Service). Service has two methods Begin method takes the AsyncCallback. Service successfully installed and started on machine.
Server:
[ServiceContract]
public interface IAdminService
{
[OperationContract(AsyncPattern = true)]
IAsyncResult BeginMyWork(int number1, int number2, AsyncCallback callback, object state);
int EndMyWork(IAsyncResult result);
}
On the Client side, added the service reference, it shows only one method “MyWork”.
ClientSide:
var service = new AdminService.AdminServiceClient();
Unable to see the BeginMyWork method on the object created on client side. How I can call BeginMyWork and pass the AsyncCallback delegate?
I have referred post to implement async: http://www.codeproject.com/Articles/121345/Asynchronous-Communication-in-a-WCF-Service
Upvotes: 1
Views: 847
Reputation: 769
Got the answer. Missed one step while configuring the service.
Select "Generate asynchronous operations" radio button.
Upvotes: 1