Developing REST Web Services using WCF - Presentation materials

As promised in the presentation I did last night for NBNUG, here is my slide deck and sample code for my REST/WCF presentation.  As I mentioned in the presentation, the sample code is purposefully not well-factored, so as not to obscure the core concepts that the code is demonstrating.  The sample code is not at all meant to convey architectural best practices for WCF-based applications, it's essentially an illustration to get folks started working with this technology.

del.icio.us Tags: ,,,

Print | posted @ Wednesday, April 22, 2009 10:48 PM

Comments on this entry:

Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by Greg Hazzard at 4/23/2009 12:22 PM

Sorry I wasn’t there Pat. I have a lot to learn from this.

What do I need to do to get your solution working as per this initial attempt; http://tinyurl.com/c5pude (got an AddressAccessDeniedException when starting the service host: "HTTP could not register URL http://+8080/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details)."

Thank you,
Greg
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by Pat Gannon at 4/23/2009 12:23 PM

Hi Greg,

You must be running Vista. :-) You need to start the service host from outside of visual studio - right click on the exe and click "start as administrator" so that the process has the privileges to listen on an HTTP port. Supposedly there is a way to fix this (assign the correct permissions) by using netsh.exe (part of Windows Vista), but I couldn't get it to work. It's not too big of a problem to start it outside of Visual Studio, though, because you can always "attach to process" in Visual Studio after you've started it if you want to debug the code in the service host. (It will tell you that you need to restart VS as an administrator, if you didn't specifically start Visual Studio 'as administrator', but just click Yes and it will handle it for you.)

Once you've got the service host running, start the client (which you can start from within Visual Studio) and it will connect to the service running 'inside' the service host.

Take care!
Pat
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by RN at 12/30/2009 12:30 AM

Hi Pat,

Its a good example.. but you have too many projects which can get confusing.

i mean .. you could have easily merged the contract with the services project.

Thanks for the example, nice one

RN
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by Pat Gannon at 1/7/2010 8:54 PM

@RN,

Actually, merging the contract and services projects would have been non-ideal IMO because then the client would have a direct reference to the service project (since it must reference the contract), and that sort of defeats the point of a web service, right?

Take care,
Pat

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 7 and 8 and type the answer here: