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 geeks at 12/22/2009 5:11 AM

Hey, that was interesting,

Keep up the good work,

Thanks for writing about it
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
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by health coverage at 1/12/2010 9:26 AM

thanks for the information.. I can learn very much from this...
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by oldest casinos at 1/23/2010 4:31 AM

I completely agree with the above comment, the internet is with a doubt growing into the most important medium of communication across the globe and its due to sites like this that ideas are spreading so quickly.
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by ppo plans at 2/1/2010 9:32 AM

will say, however, that you should first check out the very wonderful ADO.NET Data Services which was just released in the .NET Framework 3.5 SP1. It saved me a lot of effort in a couple of my projects, but I didn't have to deal with legacy code either.
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by gioco giochi casinò at 2/26/2010 2:05 AM

I am trying to use this in conjunction of RESTful services using WCF, which makes use of WebHttpBindings and WebServiceHost. Using TCP will allow for soap serialization, but I cant quite figure out why I cant make this work over HTTP. Any help would be greatly appreciated.
Gravatar # re: Developing REST Web Services using WCF - Presentation materials
by alabama web design at 3/4/2010 5:42 PM

Can you (or anyone else) shed some light into the shortcomings of ASP.NET AJAX? I ask because I'm about to embark on a project and I'm trying to wrap my head around a REST approach and see what benefits it would offer in developing AJAX enabled applications. I truly get REST for *end users* and it's abundantly clear why having all of your resources uniquely identifiable by URL is a big win, but I'm struggling with REST for developers in AJAX application scenarios.

Also: why bother with jQuery (or any other AJAX library) to make simple data retrieval requests when ASP.NET AJAX does that bit just fine? I'm a bit puzzled by this as well. I can understand wanting to use the utilities and conveniences of a given library, but why shun the default ASP.NET AJAX requests?
Gravatar # web development
by nikol at 3/9/2010 11:34 AM

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.

Your comment:

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