文档章节

Practical guide to WCF RESTful service

东风125
 东风125
发布于 2015/10/26 09:46
字数 658
阅读 22
收藏 0

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:


本文转载自:http://www.topwcftutorials.net/2014/02/practical-wcf-restful-service.html

东风125
粉丝 6
博文 73
码字总数 12747
作品 0
朝阳
高级程序员
私信 提问
简单 5 步创建你的首个 RESTful 服务

RESTful 服务遵循REST(Representational State Transfer)的架构风格。 在实现你第一个Restful 服务之前,让我们先理解它的概念。就像我们知道的那样,WCF(Windows通讯接口)让我们能够使用基于...

oschina
2013/09/27
17.5K
16
WCF技术的不同应用场景及其实现分析

历史背景: WCF,全称是Windows Communication Founcation,它作为微软新一代的通讯技术,首先正式出现在.NET Framework 3.0中,伴随着Windows Vista的发布而名噪一时。在此之前,曾经作为W...

墙头草
2011/06/21
407
0
大比速:remoting、WCF(http)、WCF(tcp)、WCF(RESTful)、asp.net core(RESTful)

近来在考虑一个服务选型,dotnet提供了众多的远程服务形式。在只考虑dotnet到dotnet的情形下,我们可以选择remoting、WCF(http)、WCF(tcp)、WCF(RESTful)、asp.net core(RESTful) 其中我考察...

生命体验之kevin-Y
2018/11/26
0
0
[转] Leaving patterns & practices

[J.D. Meier's Blog]“Life is like skiing. Just like skiing, the goal is not to get to the bottom of the hill. It’s to have a bunch of good runs before the sun sets.” – Seth G......

长平狐
2012/09/04
205
0
领域驱动设计(DDD)框架--Synopse mORMot framework

Synopse mORMot framework, 原名Synopse SQLite3 Framework 。是一个Client-Server ORM和SOA框架,适用Delphi6到XE4,Win32或Win64. 可以创建从独立方案到复杂的领域驱动设计: 表示层 MVC ...

炽火
2013/12/03
5.4K
4

没有更多内容

加载失败,请刷新页面

加载更多

Mybatis Plus删除

/** @author beth @data 2019-10-17 00:30 */ @RunWith(SpringRunner.class) @SpringBootTest public class DeleteTest { @Autowired private UserInfoMapper userInfoMapper; /** 根据id删除......

一个yuanbeth
38分钟前
4
0
总结

一、设计模式 简单工厂:一个简单而且比较杂的工厂,可以创建任何对象给你 复杂工厂:先创建一种基础类型的工厂接口,然后各自集成实现这个接口,但是每个工厂都是这个基础类的扩展分类,spr...

BobwithB
今天
4
0
java内存模型

前言 Java作为一种面向对象的,跨平台语言,其对象、内存等一直是比较难的知识点。而且很多概念的名称看起来又那么相似,很多人会傻傻分不清楚。比如本文我们要讨论的JVM内存结构、Java内存模...

ls_cherish
今天
4
0
友元函数强制转换

友元函数强制转换 p522

天王盖地虎626
昨天
5
0
js中实现页面跳转(返回前一页、后一页)

本文转载于:专业的前端网站➸js中实现页面跳转(返回前一页、后一页) 一:JS 重载页面,本地刷新,返回上一页 复制代码代码如下: <a href="javascript:history.go(-1)">返回上一页</a> <a h...

前端老手
昨天
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部