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. c++ 类的定义和使用

    在 c++ 中 类的定义为 class 类名 { };切记,类的定义完成后要加上分号,这是很多初学者容易犯的错误. 类的成员及函数 分为 public private protect 三类,大家学过 ...

  2. Struts2框架05 result标签的类型

    1 result标签是干什么的 就是结果,服务器处理完返回给浏览器的结果:是一个输出结果数据的组件 2 什么时候需要指定result标签的类型 把要输出的结果数据按照我们指定的数据类型进行处理 3 常 ...

  3. Java电器商场小系统--简单的java逻辑

    //商场类public class Goods { int no; //编号 String name; //商品名称 double price; //商品价格 int number; //商品数量 / ...

  4. json和xml封装数据、数据缓存到文件中

    一.APP的通信格式之xml xml:扩展标记语言,可以用来标记数据,定义数据类型,是一种允许用户对自己标记语言进行定义的源语言.XML格式统一,扩平台语言,非常适合数据传输和通信,业界公认的标准. ...

  5. IE事件处理

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. 软件安装(JDK+MySQL+TOMCAT)

    一,JDK安装 1,查看当前Linux系统是否已经安装了JDK 输入 rpm -qa | grep java 如果有: 卸载两个openJDK,输入rpm -e --nodeps 要卸载的软件 2,上 ...

  7. rsync工作机制(翻译)

    本篇为rsync官方推荐文章How Rsync Works的翻译,主要内容是Rsync术语说明和简单版的rsync工作原理.本篇没有通篇都进行翻译,前言直接跳过了,但为了文章的完整性,前言部分的原文还 ...

  8. [luogu P1967][NOIp2013] 货车运输

    题目描述 A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路.每一条道路对车辆都有重量限制,简称限重.现在有 q 辆货车在运输货物, 司机们想知道每辆车在不超过车辆限重的情况下,最多 ...

  9. HTTP文件下载JAVA后台的实现

    HTTP文件的下载后台JAVA代码 1.使用org.apache.http.impl.client.CloseableHttpClient 先上代码: public String downloadFi ...

  10. dubbo搭建例子

    现在很多公司用到dubbo,使用起来是很快就学会了.真的要熟悉它还是要花点功夫的. 前面尝试看了些它的源码,这里为了调试源码,先打搭一个能跑的项目,顺别分享出来,以便刚像学习的朋友节约时间,毕竟时间至 ...