I want to know what is the opinion of you fellow Developers regarding WCF WebApi services.
In an N-tier application we can have multiple layers of services. We can have services consuming data from external services. In that scenario its worth to create Async Rest Services using WCF 4.0.
public interface IService
{
[OperationContractAttribute(AsyncPattern = true)]
IAsyncResult BeginGetStock(string code, AsyncCallback callback, object asyncState);
//Note: There is no OperationContractAttribute for the end method. string EndGetStock(IAsyncResult result);
}
But with the release of WCF WebApi this approach is still required? to create async services?
How to host them in IIS/WAS/Self Hosting
looking forward for suggestion and comments.
Thankyou !
Regardless of the technology you are using on your server if you need to do blocking work (ex talk to a database, call another service) you will want to avoid blocking the thread. Threads are a valuable server resource that you need to manage carefully to
achieve the best possible scalability.
We are also hard at working integrating WCF Web API into ASP.NET MVC. The integrated stack will support the Task-based async programming model, which makes authoring async operations/actions much easier. The story gets even better if you take advantage of
the new async features in .NET 4.5.
gopalchettri
Member
39 Points
39 Posts
Async Rest services in WCF WebApi
Jan 21, 2012 06:46 AM|LINK
I want to know what is the opinion of you fellow Developers regarding WCF WebApi services.
In an N-tier application we can have multiple layers of services. We can have services consuming data from external services. In that scenario its worth to create Async Rest Services using WCF 4.0.
public interface IService
{
[OperationContractAttribute(AsyncPattern = true)]
IAsyncResult BeginGetStock(string code, AsyncCallback callback, object asyncState);
//Note: There is no OperationContractAttribute for the end method. string EndGetStock(IAsyncResult result);
}
But with the release of WCF WebApi this approach is still required? to create async services?
How to host them in IIS/WAS/Self Hosting
looking forward for suggestion and comments.
Thankyou !
GopalChettri
(MCP)
danroth27
Member
176 Points
41 Posts
Microsoft
Re: Async Rest services in WCF WebApi
Jan 24, 2012 05:30 PM|LINK
Regardless of the technology you are using on your server if you need to do blocking work (ex talk to a database, call another service) you will want to avoid blocking the thread. Threads are a valuable server resource that you need to manage carefully to achieve the best possible scalability.
We are also hard at working integrating WCF Web API into ASP.NET MVC. The integrated stack will support the Task-based async programming model, which makes authoring async operations/actions much easier. The story gets even better if you take advantage of the new async features in .NET 4.5.
Hope this helps.
Daniel Roth
Senior Program Manager
ASP.NET