views:

49

answers:

3

Hi,

I'm currently trying to access a REST API for the first time using visual web developer 2008 express edition.

Every article I have found says you have to install the WCF REST starter kit which is a .msi file, which would suggest that I have to install it on my machine and presumably our server too.

My question is this. Is there a non installable version that I can use, e.g. just by dropping DLLs into the Bin directory and then using the classes contained. Or is there more to it than that and am I just getting very confused about how it works?

Jon

+1  A: 

You'll find that the msi just installs/registers the dlls and the Visual Studio project templates for common REST scenarios. See the first section of this article.

EDIT: Once referenced (you will have to browse to the install folder of the starter kit to add the reference), the dlls will be be copied to the output directory (because the CopyLocal property of the reference in VS will be true) so when you publish the project via VS (or compile) the dlls will be included in the bin folder (so no you will not have to install the starter kit on the server also).

Simon Fox
SO, if I install it on my machine here, can I then just copy the DLLs to the server or do I have to install the msi on the server too?
jonhobbs
@jonhobbs see my edit...
Simon Fox
A: 

The easiest way to use REST APIs in Visual Studio / Web Developer is to right click on your website in the Solution Explorer and go to Add Web Reference...

Paul
Add Web Reference will only work if the "REST" service has been created by a very specific set of Microsoft technologies. Using it also negates most of the benefits of using REST over SOAP.
Darrel Miller
+1  A: 

When you install the WCF REST Starter kit it will create a folder

C:\Program Files (x86)\Microsoft WCF REST\WCF REST Starter Kit Preview 2\Assemblies

In this folder are the following DLLs.

 Microsoft.Http.dll
 Microsoft.Http.Extensions.dll
 Microsoft.ServiceModel.Web.dll

The first two are used as a client library to access HTTP based interfaces. The third dll is an extension to WCF's System.ServiceModel.Web that fixes some of the problems with creating REST services using WCF.

The DLLs you need depend on whether you are trying to create a REST api, or consume an existing one.

Darrel Miller