Practical guide to WCF RESTful service

REST (Representational State Transfer) is an architectural style that dictates to think in terms of resources and their representation instead of just thinking about methods within a system. REST architecture focuses almost on the same set of constraints like Uniform interface, separation of concerns, caching, statelessness etc. as other distributed architecture follow.
Using REST, we get the following advantages:

  • Interoperability
  • Scalability
  • Performance
  • Efficiency
  • Independent Evolution
  • and many more…

REST also means using HTTP the way it meant to be. But a simple WCF service uses HTTP only as a transport, although HTTP is much more than just a transport. HTTP is already designed in the way as RESTful architecture suggests. RESTful services are also referred as HTTP services because HTTP also focuses on interaction between resources and their representation.


HTTP is the standard protocol for the all communication between resources over the Web. So, it defines various methods for interaction with resources as follows:

  • GET:-  means requesting a specific representation of a resource.
  • PUT:-  means creating or updating a resource with a provided representation.
  • DELETE:-  simply defines, deleting the specific resource.
  • POST:-  defines submitting data to be processed by the identified resource.
  • HEAD:-  is similar to GET but only retrieve header not the body.
  • OPTIONS:-  it returns the method supported by the identified resource.

So far in this guide, we talked a lot about REST and related concepts. Lets move further to practically implementing all these concepts. We will start this WCF tutorial from beginner level and take to professional level.

Chapter 1:-  Creating your first WCF RESTful service
In this chapter, we will create a basic WCF REST service. Following a step by step approach in creating RESTful service with complete code sample, we will discuss service and behavior configuration and talk about webHttpBinding also. Finally, running the service and getting results in our browser window.

Chapter 2:-  Consuming WCF RESTful service using jQuery
Now, we have a REST service available. Here in this chapter, focus remains on consuming already created RESTful service using jQuery. As jQuery simplifies AJAX call for a REST-based service, complete jQuery code provided and finally results are rendered in HTML.

Chapter 3:- Performing CRUD operations using WCF RESTful service – Part 1
In chapter 3, we have broaden our scope and provided all CRUD (Create, Retrieve, Update, Delete) operations for our service for a specific domain model.

Chapter 4:- Performing CRUD operations using WCF RESTful service – Part 2
This chapter focuses on consuming WCF REST service for all CRUD operations developed in earlier chapter using jQuery. Untill here, reader will have understanding of core concepts and also able to create a small RESTful service application by himself.

Chapter 5:- Posting JSON data to WCF RESTful service using jQuery
So far, we discussed and implemented different HTTP methods like GET, PUT, DELETE. In this part of guide, we discussed on using POST HTTP method for sending data to a HTTP service in JSON format.

Chapter 6:- Automatic Format Selection in WCF RESTful service
WebHttpBehavior class introduces AutomaticFormatSelectionEnabled property in .NET framework version 4.0. This chapter focuses on how this new feature of Automatic Format Selection works for a service operation.

Chapter 7:- Exception Handling in WCF RESTful service
Finally, in this chapter we discussed about handling exceptions for a WCF RESTful service.

This WCF tutorial guide provide thorough understanding with complete code for learning HTTP service and covers all major areas for web developers working with RESTful services in WCF.

Top 10 Interview Questions and Answers Series:


转载于:https://my.oschina.net/ITELITE/blog/521968

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值