Create new REST Service in Visual Studio 2010 - Template is now out of date?

Topics: Web Api, WebSockets
Jan 23, 2011 at 11:03 AM

Hi there,

 

I initially downloaded the template (available via extensions on vs 2010) which basically creates wcf REST service for me on .Net 4.0.

 

Does this now mean that the template that i have downloaded and was using is now not the recommended way of doing this?

 

and THis framework overtakes it?  Is there a template for this framework for VS 2010?

 

Maybe i am mistaken but the framework seems to support both client and server and REST and SOAP?

 

Any help really appreciated

 

Thanks

Coordinator
Jan 23, 2011 at 8:22 PM

Hi John

If you are using .NET 4.0 and ASP.NET for your hosting, I would consider downloading the REST template we have in the Visual Studio Extension gallery. It is newer and use the new ServiceRoute which we introduced in 4.0 for integrating with ASP.NET routes. That is the recommended way for developing on 4.

As far as our newer bits, we don't have a template "yet", though thank you for pointing that out. That is something we should look into including in the box. We did create a nuget package for WcfWebApi with our last drop which needs to get updated. With the nuget pack you can take an empty asp.net project and upgrade it to have the appropriate references / config file changes made to your solution. You could check that out for now to get started. I will work on getting it updated :-)

The web api is focused completely on exposing services and data over raw HTTP not through SOAP. We heard a lot of feedback that folks who care only about HTTP want an experience that is completely focused on HTTP, and not abstracted away to support different transports / app layer protocols other than HTTP. So for that reason our API/Programming model is HTTP specific. As an example you can get raw access to HTTP by taking HttpRequestMessage and HttpResponseMessage as parameters to your operation. This gives you unfettered access to the underlying HTTP body and headers. However it makes no sense if you are a SOAP service that is over a NetTcp binding.

Does that help?

Jan 24, 2011 at 10:58 AM

Yes Glenn, thanks it does....  I was just really looking for the confirmation that i am still doing things correctly :-)

 

Yes i have the template already downloaded from  the extensions library and it works great.

 

thanks once again