How to make a simplest WCF service work on Win7 with VS2010
You know as a beginner to learn WCF, the first thing is to make a simplest WCF service work like a classic "Hello World" console application. Now I will introduce the steps by following:
1.Create a "WCF Application Service" like this:
2. Rename the "IService1" to "ICalculatorService" and "Service1" to "CalculatorService" for both project file name and interface/class name in source code, and then update the generated code by default to following:

3. Set as start page for "CalculatorService.svc" and then hit F5 to lauch the WCFServiceTestClient

4. Open IIS and "Sites->Add Website...", click OK button as below:

5. Right click the new added site and select "Add Virtual Directory...", after that, switch to "Content View" you can see below:

6. Right click the new added virtual directory "Calculator" and then select "Convert to Application", click OK button
7. Right click the converted "Calculator" and then "Manage Applicataion->Browse"
8. If happen below error, need to change the Application Pool's .NET framework version to 4.0 as following:

9. If happen below error, need to enable the "Directory Browsing" as the guided steps:

10. Repeat step7 and then click the link "CalculatorService.svc", if you can see the second picture, congratulations!


11. If you are failed to see above picture, probably some ASP.NET components are not installed, so please first check if the 6 items are existing:

If not, please make sure below features are installed:



12. Below is the optional steps, if above doesn't work:
Run cmd as administrator and then cd to "C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation", execute below commandline:
ServiceModelReg.exe -i
If above step generate any bad impact/result, I mean browse the created WCF service will happen some strange errors, we can rollback by executing below commandline:
ServiceModelReg.exe -u
13. Another optional step is(probably it doesn't need to do):

14. I believe the WCF service is published successfully be above several steps given, from then on, I will create a console applicaiton named "CalculatorClient" to consume the published WCF service.

14. Right click "References" and then select "Add Service Reference...", input the WCF service address and then click "OK" button:

15. Add client code to call WCF service, the calling result is showed as below picture, till now our first WCF learning sample is done here. :)
How to make a simplest WCF service work on Win7 with VS2010的更多相关文章
- 如何创建一个RESTful WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4044813.html 转载请注明出处 (一)web.config文件 要创建REST WCF Service,endpoin ...
- 如何创建一个AJAX-Enabled WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4041638.html 转载请注明出处 前面的文章中介绍过<Step by Step 创建一个WCF Servi ...
- 用JavaScript调用WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4039604.html 转载请注明出处 前面介绍过<Step by Step 创建一个WCF Service>和& ...
- Step by Step 创建一个WCF Service
原创地址:http://www.cnblogs.com/jfzhu/p/4025448.html 转载请注明出处 (一)创建WCF Service (1)创建WCF Service类库 创建一个Cla ...
- Deploying an Internet Information Services-Hosted WCF Service
Deploying an Internet Information Services-Hosted WCF Service .NET Framework 4 Other Versions .NET ...
- Azure开发者任务之六:使用WCF Service Web Role
在本文中,我们将会在local development fabric上创建一个WCF服务角色,然后在一个控制台应用程序中使用它. WCF服务角色可以让我们创建一个WCF服务,并且把它托管在Window ...
- WCF - Consuming WCF Service
WCF services allow other applications to access or consume them. A WCF service can be consumed by ma ...
- WCF - Hosting WCF Service
After creating a WCF service, the next step is to host it so that the client applications can consum ...
- WCF - Creating WCF Service
http://www.tutorialspoint.com/wcf/wcf_creating_service.htm Creating a WCF service is a simple task u ...
随机推荐
- C#将datatable的某一列转换成json格式的字符串
将datatable的某一列转换成json格式的字符串(转换完后自己在字符串前后加{}) /// <summary> ///DataTable装换 Column数据 组合成json 现在的 ...
- js几秒以后倒计时跳转示例
代码如下: <html> <head> <title>出错啦~~~</title> <link href="css/login1.css ...
- java基础系列--Exception异常处理
原创作品,可以转载,但是请标注出处地址:http://www.cnblogs.com/V1haoge/p/7191280.html 1.概述 Java代码中的异常处理是非常重要的一环,从代码中可以看到 ...
- eclipse maven构建
run as --> maven install 1.No compiler is provided in this environment. Perhaps you are running o ...
- 决策树(ID3 )原理及实现
1.决策树原理 1.1.定义 分类决策树模型是一种描述对实例进行分类的树形结构.决策树由结点和有向边组成.结点有两种类型:内部节点和叶节点,内部节点表示一个特征或属性,叶节点表示一个类. 举一个通俗的 ...
- IDEA 单元测试testng入门及testng.xml
直接进入正题: 1.TestNG的运行方式如下: With a testng.xml file 直接run as test suite With ant 使用ant From the command ...
- 实验楼 1. k-近邻算法实现手写数字识别系统--《机器学习实战 》
首先看看一些关键词:K-NN算法,训练集,测试集,特征(空间),标签 举实验楼中的样例,通俗的讲讲K-NN算法:电影有两个分类(标签)-动作片-爱情片.两个特征--打斗场面--亲吻画面. 将那些数字和 ...
- DDD理论学习系列(12)-- 仓储
DDD理论学习系列--案例及目录 1. 引言 DDD中Repository这个单词,主要有两种翻译:资源库和仓储,本文取仓储之译. 说到仓储,我们肯定就想到了仓库,仓库一般用来存放货物,而仓库一般由仓 ...
- 学生成绩管理系统——C语言实现
一.功能实现: 0.浏览学生信息 1.输入学生信息 2.增加学生信息 3.修改学生信息 4.删除学生信息 5.按学号查询 6.按班级查询 7.按姓名查询 8.按课堂名称查询 9.按总分高低排序 10. ...
- Mybatis Dynamic Query 框架整合
项目地址:https://github.com/wz2cool/mybatis-dynamic-query 文档地址:https://wz2cool.gitbooks.io/mybatis-dynam ...