alexanderzeitler.com - REST using the WCF Web API – Basics (Part2)









Search Preview

REST using the WCF Web API – Basics (Part2) | Alexander Zeitler

alexanderzeitler.com

.com > alexanderzeitler.com

SEO audit: Content analysis

Language Error! No language localisation is found.
Title REST using the WCF Web API – Basics (Part2) | Alexander Zeitler
Text / HTML ratio 50 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud Web API WCF REST Part public = class method RESTful Contact Microsoft Id configuration HTTP URI simple BDD JSON list
Keywords consistency
Keyword Content Title Description Headings
Web 24
API 23
WCF 17
REST 15
Part 10
public 9
Headings
H1 H2 H3 H4 H5 H6
1 0 0 0 0 0
Images We found 6 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
Web 24 1.20 %
API 23 1.15 %
WCF 17 0.85 %
REST 15 0.75 %
Part 10 0.50 %
public 9 0.45 %
= 6 0.30 %
class 6 0.30 %
method 6 0.30 %
RESTful 6 0.30 %
Contact 5 0.25 %
Microsoft 4 0.20 %
Id 4 0.20 %
configuration 4 0.20 %
HTTP 4 0.20 %
URI 4 0.20 %
simple 3 0.15 %
BDD 3 0.15 %
JSON 3 0.15 %
list 3 0.15 %

SEO Keywords (Two Word)

Keyword Occurrence Density
Web API 23 1.15 %
using the 14 0.70 %
WCF Web 13 0.65 %
the WCF 12 0.60 %
REST using 11 0.55 %
API getting 4 0.20 %
Name = 3 0.15 %
the BDD 3 0.15 %
BDD way 3 0.15 %
more RESTful 3 0.15 %
done by 3 0.15 %
is done 3 0.15 %
new Contact 3 0.15 %
Id = 3 0.15 %
Contact Id 3 0.15 %
Basics Part2 3 0.15 %
to the 3 0.15 %
public class 3 0.15 %
getting RESTful 2 0.10 %
RESTful the 2 0.10 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
WCF Web API 13 0.65 % No
the WCF Web 12 0.60 % No
REST using the 11 0.55 % No
using the WCF 11 0.55 % No
Web API getting 4 0.20 % No
the BDD way 3 0.15 % No
is done by 3 0.15 % No
Contact Id = 3 0.15 % No
new Contact Id 3 0.15 % No
RESTful the BDD 2 0.10 % No
getting RESTful the 2 0.10 % No
API getting RESTful 2 0.10 % No
3 REST using 2 0.10 % No
API getting more 2 0.10 % No
Part 3 REST 2 0.10 % No
style Part 3 2 0.10 % No
IoC style Part 2 0.10 % No
BDD way Part 2 0.10 % No
API refactoring to 2 0.10 % No
Web API refactoring 2 0.10 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
the WCF Web API 12 0.60 % No
REST using the WCF 11 0.55 % No
using the WCF Web 11 0.55 % No
WCF Web API getting 4 0.20 % No
new Contact Id = 3 0.15 % No
4 REST using the 2 0.10 % No
style Part 3 REST 2 0.10 % No
API getting RESTful the 2 0.10 % No
Web API getting RESTful 2 0.10 % No
3 REST using the 2 0.10 % No
Part 3 REST using 2 0.10 % No
refactoring to IoC style 2 0.10 % No
IoC style Part 3 2 0.10 % No
to IoC style Part 2 0.10 % No
RESTful the BDD way 2 0.10 % No
Web API refactoring to 2 0.10 % No
WCF Web API refactoring 2 0.10 % No
one REST using the 2 0.10 % No
this one REST using 2 0.10 % No
getting RESTful the BDD 2 0.10 % No

Internal links in - alexanderzeitler.com

Fixing Chrome 58+ [missing_subjectAltName] with openssl when using self signed certificates
Fixing Chrome 58+ [missing_subjectAltName] with openssl when using self signed certificates | Alexander Zeitler
Accessing an HTTP API running on your MacBook in a Docker container from your iPhone/iPad using dnsmasq
Accessing an HTTP API running on your MacBook in a Docker container from your iPhone/iPad using dnsmasq | Alexander Zeitler
Deploying Ubuntu Mate Desktop as a developer environment in a Azure VM
Deploying Ubuntu Mate Desktop as a developer environment in a Azure VM | Alexander Zeitler
Deploying Ubuntu Mate Desktop as a developer environment in AWS EC2
Deploying Ubuntu Mate Desktop as a developer environment in AWS EC2 | Alexander Zeitler
Debugging mocha tests in a Docker container using Visual Studio Code
Debugging mocha tests in a Docker container using Visual Studio Code | Alexander Zeitler
Debugging mocha tests with Visual Studio Code when Node.js is installed using nvm
Debugging mocha tests with Visual Studio Code when Node.js is installed using nvm | Alexander Zeitler
Debugging a ES6 Node.js application in a Docker container using Visual Studio Code
Debugging a ES6 Node.js application in a Docker container using Visual Studio Code | Alexander Zeitler
Some thoughts on Open Source Software
Some thoughts on Open Source Software | Alexander Zeitler
Resizing a VMware Workstation VM partition using GParted - get the swap partition out of my way!
Resizing a VMware Workstation VM partition using GParted - get the swap partition out of my way! | Alexander Zeitler
Workflows: using Docker Machine and Docker Compose together in development
Workflows: using Docker Machine and Docker Compose together in development | Alexander Zeitler
Chrome crashes on Ubuntu in VMware Workstation
Chrome crashes on Ubuntu in VMware Workstation | Alexander Zeitler
Rename Visual Studio project including files, folders and namespaces
Rename Visual Studio project including files, folders and namespaces | Alexander Zeitler
A lap around AWS and docker-machine
A lap around AWS and docker-machine | Alexander Zeitler
Integration-testing ASP.NET 5 / MVC 6 Controllers on DNX Beta 4
Integration-testing ASP.NET 5 / MVC 6 Controllers on DNX Beta 4 | Alexander Zeitler
Deploying a ASP.NET MVC 6 API as Azure API App in Azure App Services
Deploying a ASP.NET MVC 6 API as Azure API App in Azure App Services | Alexander Zeitler
lowerCamelCase JSON with ASP.NET MVC 6
lowerCamelCase JSON with ASP.NET MVC 6 | Alexander Zeitler
Running ASP.NET 5 Beta 4 in Docker with DNX runtime #aspnet5 #docker
Running ASP.NET 5 Beta 4 in Docker with DNX runtime #aspnet5 #docker | Alexander Zeitler
Stop complaining or improve yourself
Stop complaining or improve yourself | Alexander Zeitler
#NodeJS / #ExpressJS: Adding routes dynamically at runtime
#NodeJS / #ExpressJS: Adding routes dynamically at runtime | Alexander Zeitler
mongoose: Referencing schema in properties or arrays
mongoose: Referencing schema in properties or arrays | Alexander Zeitler
MongoDB development environment journal size management using mongoctl
MongoDB development environment journal size management using mongoctl | Alexander Zeitler
Farewell...
Farewell... | Alexander Zeitler
Inspecting AngularJS $scope using Firebug and Chrome Developer Tools
Inspecting AngularJS $scope using Firebug and Chrome Developer Tools | Alexander Zeitler
Useful @Brackets extensions for Web Developers
Useful @Brackets extensions for Web Developers | Alexander Zeitler
.NET User Group Karlsruhe: StreamInsight: Complex Event Processing by Microsoft
.NET User Group Karlsruhe: StreamInsight: Complex Event Processing by Microsoft | Alexander Zeitler
“Commit all must be called when a managed buffer has focus” in Microsoft SQL Server Data Tools
“Commit all must be called when a managed buffer has focus” in Microsoft SQL Server Data Tools | Alexander Zeitler
.NET User Group Karlsruhe: Git
.NET User Group Karlsruhe: Git | Alexander Zeitler
Open Source Windows 8 App: Sprudelsuche
Open Source Windows 8 App: Sprudelsuche | Alexander Zeitler
Open Source– Scheissegal?
Open Source– Scheissegal? | Alexander Zeitler
Lowercase JSON with ASP.NET Web API
Lowercase JSON with ASP.NET Web API | Alexander Zeitler
.NET Usergroup Karlsruhe: Think Big – Entwicklung skalierbarer Anwendungen mit Windows Azure
.NET Usergroup Karlsruhe: Think Big – Entwicklung skalierbarer Anwendungen mit Windows Azure | Alexander Zeitler
ASP.NET Web API and RavenDb
ASP.NET Web API and RavenDb | Alexander Zeitler
ASP.NET Web API Round-Up Slides
ASP.NET Web API Round-Up Slides | Alexander Zeitler
ASP.NET MVC 4 public beta including ASP.NET Web API
ASP.NET MVC 4 public beta including ASP.NET Web API | Alexander Zeitler
Hash Bang Urls in Single Page Applications mit ASP.NET MVC
Hash Bang Urls in Single Page Applications mit ASP.NET MVC | Alexander Zeitler
.NET User Group Karlsruhe: Know your Tools
.NET User Group Karlsruhe: Know your Tools | Alexander Zeitler
Git flow init liefert: flags: FATAL unable to determine getopt version unter Cygwin
Git flow init liefert: flags: FATAL unable to determine getopt version unter Cygwin | Alexander Zeitler
Using JsonValue and JsonArray in WCF Web API
Using JsonValue and JsonArray in WCF Web API | Alexander Zeitler
.NET User Group Karlsruhe: PowerShell 3.. 2.. 1..
.NET User Group Karlsruhe: PowerShell 3.. 2.. 1.. | Alexander Zeitler
What’s new in WCF Web API Preview 5 – introducing the test client
What’s new in WCF Web API Preview 5 – introducing the test client | Alexander Zeitler
Externe Templates in KnockoutJS laden
Externe Templates in KnockoutJS laden | Alexander Zeitler
WCF Web API: Role based access control with basic authentication
WCF Web API: Role based access control with basic authentication | Alexander Zeitler
.NET User Group Karlsruhe: Produce Cleaner Code with Aspect-Oriented Programming (AOP)
.NET User Group Karlsruhe: Produce Cleaner Code with Aspect-Oriented Programming (AOP) | Alexander Zeitler
REST using the WCF Web API – POST it!
REST using the WCF Web API – POST it! | Alexander Zeitler
REST using the WCF Web API – getting more RESTful responses (Part 5)
REST using the WCF Web API – getting more RESTful responses (Part 5) | Alexander Zeitler
TypeLoadException when mocking COM objects - Could not load type … from assembly. The type is marked…
TypeLoadException when mocking COM objects - Could not load type … from assembly. The type is marked… | Alexander Zeitler
REST using the WCF Web API – getting RESTful the BDD way (Part 4)
REST using the WCF Web API – getting RESTful the BDD way (Part 4) | Alexander Zeitler
REST using the WCF Web API – refactoring to IoC style (Part 3)
REST using the WCF Web API – refactoring to IoC style (Part 3) | Alexander Zeitler
REST using the WCF Web API – Basics (Part2)
REST using the WCF Web API – Basics (Part2) | Alexander Zeitler
Microsoft Web API – the REST is done by WCF (Part 1)
Microsoft Web API – the REST is done by WCF (Part 1) | Alexander Zeitler
Microsoft Web API – den REST macht WCF (Teil 1)
Microsoft Web API – den REST macht WCF (Teil 1) | Alexander Zeitler
.NET User Group Karlsruhe: Flexible Softwarearchitekturen mit Inversion of Control (IoC)
.NET User Group Karlsruhe: Flexible Softwarearchitekturen mit Inversion of Control (IoC) | Alexander Zeitler
machine.fakes ReSharper Templates
machine.fakes ReSharper Templates | Alexander Zeitler
CreateCert.cmd aus dem Windows Azure Platform Training Kit funktioniert nicht
CreateCert.cmd aus dem Windows Azure Platform Training Kit funktioniert nicht | Alexander Zeitler
JSON via jQuery direkt an einen ASP.NET MVC 3 Controller senden
JSON via jQuery direkt an einen ASP.NET MVC 3 Controller senden | Alexander Zeitler
POSTing Json data using the HttpClient from WCF Web API
POSTing Json data using the HttpClient from WCF Web API | Alexander Zeitler
Using the new WCF Web APIs HttpClient with ASP.NET Forms Authentication
Using the new WCF Web APIs HttpClient with ASP.NET Forms Authentication | Alexander Zeitler
Keyboard Jedi unter x64
Keyboard Jedi unter x64 | Alexander Zeitler
Using WCF Web APIs / WCF Http with ASP.NET Forms Authentication
Using WCF Web APIs / WCF Http with ASP.NET Forms Authentication | Alexander Zeitler
WCF Web APIs / WCF Http mit ASP.NET Forms Authentication verwenden
WCF Web APIs / WCF Http mit ASP.NET Forms Authentication verwenden | Alexander Zeitler
ILSpy – Open Source .NET Assembly Browser und Decompiler
ILSpy – Open Source .NET Assembly Browser und Decompiler | Alexander Zeitler

Alexanderzeitler.com Spined HTML


REST using the WCF Web API – Basics (Part2) | Alexander Zeitler Toggle navigation Home Feed REST using the WCF Web API – Basics (Part2) Written on April 16, 2011 Postings published on this series so far: Microsoft Web API -- the REST is washed-up by WCF (Part 1) REST using the WCF Web API -- Basics (Part2) -- this one REST using the WCF Web API -- refactoring to IoC style (Part 3) REST using the WCF Web API -- getting RESTful the BDD way (Part 4) REST using the WCF Web API -- getting increasingly RESTful responses (Part 5) REST using the WCF Web API -- Post it! (Part 6) As written in the first posting, RESTful Services wilt increasingly and increasingly important nowadays and Microsoft has started to make WCF a first matriculation HTTP resider by implementing the WCF Web API. To get started using the Web API, create a new, empty "ASP.NET MVC 3 Web Application" project. First of all you'll have to get the latest shit which is through the kindness of NuGet scrutinizingly a no-brainer. Just add the Package reference to the "WebApi.All" package: When finished installing, add a new matriculation to your project tabbed ContactsResource. First aim of Web API: alimony things simple -- that's what we'll start with: a simple Resource returning a list of contacts. Doing so is a straight forward implementation using Web API: [ServiceContract] public matriculation ContactsResource { public List<contact> Get() { return new List<contact>() { new Contact() { Id = 1, Name = "Glenn Block" }, new Contact() { Id = 2, Name = "Scott Hanselman" }, new Contact() { Id = 3, Name = "Scott Guthrie" } }; } } The Contact matriculation itself is moreover pretty simple -- no magic at all: public matriculation Contact { public int Id { get; set; } public string Name { get; set; } } To tell Web API which URI to map the contacts resource to, we need to pinpoint a URI template. This is washed-up by subtracting an symbol to the Get()-method. This symbol moreover tells Web API which HTTP method to map to the method -- as we want to read the list, equal to REST principles the HTTP method of nomination is GET. Thus our attributed method looks like this now: [WebGet(UriTemplate = "")] public List<Contact> Get() { The reason why UriTemplate is an empty string, is that we want to wangle the list of contacts using the pursuit URI: http://localhost:3421/contacts So the next consequential question should be: how does Web API know to undeniability our Get method when the whilom URI is requested? Simply put: by it's configuration. Despite it's WCF background, configuration in Web API is no XML monster but instead a fancy fluent interface. To get our vital implementation running, just add the pursuit lines to your RegisterRoutes method in Globals.asax.cs: var configuration =HttpHostConfiguration.Create() .SetResourceFactory(new ContactsResourceFactory()); RouteTable.Routes.MapServiceRoute<ContactsResource>("contacts", configuration); The ContactsResourceFactory implements IResourceFactory having to methods: public matriculation ContactResourceFactory : IResourceFactory { public object GetInstance(Type serviceType, InstanceContext instanceContext, HttpRequestMessage request) { return new ContactsResource(); } public void ReleaseInstance(InstanceContext instanceContext, object service) { throw new NotImplementedException(); } } Starting up our web using and navigating to http://localhost:3421/contacts returns this XML: As REST often is well-nigh JSON, Web API covers this moreover out of the box. Just start up Fiddler and craft your own HTTP request unsuspicious JSON and hit the Execute button: Guess what! We get some JSON back: Seeing that we'll finish our first small lap virtually the Microsoft WCF Web API. But I'll promise, there's a lot increasingly to come. In the next postings we'll refactor our example to be increasingly RESTful and we'll test our implementations the BDD way using machine.fakes / machine.specifications. Furthermore we'll wire things up using the LightCore IoC-Container. Stay tuned! Postings published on this series so far: Microsoft Web API -- the REST is washed-up by WCF (Part 1) REST using the WCF Web API -- Basics (Part2) -- this one REST using the WCF Web API -- refactoring to IoC style (Part 3) REST using the WCF Web API -- getting RESTful the BDD way (Part 4) REST using the WCF Web API -- getting increasingly RESTful responses (Part 5) REST using the WCF Web API -- Post it! (Part 6) .aspx&bgcolor=3169AD&fgcolor=FFFFFF&border=000000&cbgcolor=D4E1ED&cfgcolor=000000) Please enable JavaScript to view the comments powered by Disqus. Copyright © Alexander Zeitler 2003 - 2016 | Impressum