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 ...
随机推荐
- jQuery选择器分类
jQuery的基本选择器 选择器的分类 <!--1.基本选择器 2.层级选择器 3.过滤选择器 3.1 基本过滤选择器 3.2 内容过滤选择器 3.3 可见性过滤选择器 3.4 子元素过滤选择器 ...
- Android6.0 中appcompat_v7 报错
更新了AndroidSDK以后 各种错误,新建一个项目会附赠一个appcompat_v7,你只要知道这个是一个兼容包就可以了,具体的特性可以看相关介绍,其实也没啥特别的就是为了兼容低版本的呗, 但是呢 ...
- 學習 DT device tree 以 ST 的開發板 STM32F429i-disc1 為例
目標 因為對 device tree 不是很熟悉, 所以就將 device tree, 設為學習目標. 啟動 注意, 這篇隨筆的解說都放在最下面,會標 Explanation_XX,只要搜尋 Expl ...
- Spring ContentNegotiatingViewResolver
1. Spring 返回视图采用了ViewResolver,如果一般是jsp的话,可以采用InternalResourceViewResolver. 2.还可以通过ContentNegotiating ...
- html中的锚点
一.页面内跳转的锚点设置 页面内的跳转需要两步: 方法一: ①:设置一个锚点链接<a href="#miao">去找喵星人</a>:(注意:href属性的属 ...
- Luogu 1060 开心的金明 / NOIP 2006 (动态规划)
Luogu 1060 开心的金明 / NOIP 2006 (动态规划) Description 金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间.更让他高兴的是,妈妈昨 ...
- 以Random Forests和AdaBoost为例介绍下bagging和boosting方法
我们学过决策树.朴素贝叶斯.SVM.K近邻等分类器算法,他们各有优缺点:自然的,我们可以将这些分类器组合起来成为一个性能更好的分类器,这种组合结果被称为 集成方法 (ensemble method)或 ...
- 华为OJ之放苹果
题目描述: 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法.输入每个用例包含二个整数M和N.0<=m< ...
- 解决无线网络连接出现黄色感叹号---win10
今天使用公司的电脑,这个电脑是另一位同事用过的,然后到我这里就连不上网了.然后把自己解决的方法记录一下: 开始运行输入以下命令来重置IP. 打开运行输入:cmd 在命令窗口中输入:ipconfig / ...
- Android studio导出AAR包问题整理。
最近因为项目需求开始整理一个SDK 以AAR的方式提供出去.在整理的过程中遇到了很多坑. 以下是一些总结希望能帮助遇到同样问题的人. 1.怎么导出AAR,这种文章太多了,我贴一个大家可以做参考. ht ...