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的更多相关文章

  1. 如何创建一个RESTful WCF Service

    原创地址:http://www.cnblogs.com/jfzhu/p/4044813.html 转载请注明出处 (一)web.config文件 要创建REST WCF Service,endpoin ...

  2. 如何创建一个AJAX-Enabled WCF Service

      原创地址:http://www.cnblogs.com/jfzhu/p/4041638.html 转载请注明出处   前面的文章中介绍过<Step by Step 创建一个WCF Servi ...

  3. 用JavaScript调用WCF Service

    原创地址:http://www.cnblogs.com/jfzhu/p/4039604.html 转载请注明出处 前面介绍过<Step by Step 创建一个WCF Service>和& ...

  4. Step by Step 创建一个WCF Service

    原创地址:http://www.cnblogs.com/jfzhu/p/4025448.html 转载请注明出处 (一)创建WCF Service (1)创建WCF Service类库 创建一个Cla ...

  5. Deploying an Internet Information Services-Hosted WCF Service

    Deploying an Internet Information Services-Hosted WCF Service .NET Framework 4   Other Versions .NET ...

  6. Azure开发者任务之六:使用WCF Service Web Role

    在本文中,我们将会在local development fabric上创建一个WCF服务角色,然后在一个控制台应用程序中使用它. WCF服务角色可以让我们创建一个WCF服务,并且把它托管在Window ...

  7. WCF - Consuming WCF Service

    WCF services allow other applications to access or consume them. A WCF service can be consumed by ma ...

  8. WCF - Hosting WCF Service

    After creating a WCF service, the next step is to host it so that the client applications can consum ...

  9. WCF - Creating WCF Service

    http://www.tutorialspoint.com/wcf/wcf_creating_service.htm Creating a WCF service is a simple task u ...

随机推荐

  1. Windows平台下搭建MySQL数据库

    1.下载安装MySQL数据库: (1)->我的标签->软件下载->计算机相关专业所用软件---百度云链接下载->mysql-installer-community-5.7.18 ...

  2. Java之数字处理类浅析

    包装类: 数据类型相对的包装类:byte---Byteshort---Shortint---Integerlong---Long float---Floatdouble---Double boolea ...

  3. win7下elasticsearch5.0 安装head插件

    项目开发用到了ES,5.X版本的,然而网上好多的安装资料都不能用,全是之前的老版本,今天弄了一上午终于完事了,总结一下安装的步骤. 1.安装NodeJs 去官网https://nodejs.org/e ...

  4. MongoDB安全及身份认证

    前面的话 本文将详细介绍MongoDB安全相关的内容 概述 MongoDB安全主要包括以下4个方面 1.物理隔离 系统不论设计的多么完善,在实施过程中,总会存在一些漏洞.如果能够把不安全的使用方与Mo ...

  5. CentOS的改变系统启动级别

    CentOS7改变系统启动级别   systemctl命令:   文本模式:systemctl set-default multi-user.target 图形模式:systemctl set-def ...

  6. 【菜鸟入门】安装配置eclipse 并编写运行第一个Java程序

    不得不吐槽一下,安装配置这eclipse真是太费劲了...下面总结一下,以便下次再安装 本人 win10系统,64位机 一.在官网下载eclipse安装包 文件名:eclipse-inst-win64 ...

  7. ES6正则表达式扩展

    前面的话 正则表达式是javascript操作字符串的一个重要组成部分,但在以往的版本中并未有太多改变.然而,在ES6中,随着字符串操作的变更, ES6也对正则表达式进行了一些更新.本文将详细介绍ES ...

  8. 从零开始搭建Jenkins+Docker自动化集成环境

    本文只简单标记下大概的步骤,具体搭建各个部分的细节,还请自行搜索.第一.二部分只是对Jenkins和Docker的简单介绍,熟悉的同学请直接跳到第三部分. 一.关于Jenkins Jenkins简介 ...

  9. STS 配置tomcat以后,无法访问

    问题 今天在新环境下安装开发环境STS,使用的的3.9,如下图 安装完成之后配置Tomcat,在STS启动Tocat后,在浏览器输入:http://localhost:8080/ 发现无法访问... ...

  10. Spring boot——logback 基础使用篇(一)

    1 简单日志配置 spring boot内部使用Commons Logging来记录日志,但也保留外部接口可以让一些日志框架来进行实现,例如Java Util Logging,Log4J2还有Logb ...