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. :)

最新文章

  1. 首次接触nodejs
  2. 小结-stm32 驱动LED灯
  3. PHP代码编写规范
  4. TComboBoxEx和 TComboBox
  5. 【Java学习笔记】Map接口的子接口---TreeMap
  6. webpack +vue开发(1)
  7. C与Python变量的区别
  8. OC基础(11)
  9. phpstorm配置Xdebug进行调试PHP教程
  10. HDU-1078
  11. HDU 5145 - NPY and girls
  12. 【机器学习基础】对 softmax 和 cross-entropy 求导
  13. 2018-01-11 Antlr4实现数学四则运算
  14. Scrapy学习篇(二)之常用命令行工具
  15. 自动生成编号(B开头后跟6位,数据库查询不重复)
  16. Web安全测试-WebScarab
  17. C#托管堆对象实例包含什么
  18. repo 安装
  19. Httpclient 支持https(转)
  20. linux开放关闭防火墙端口

热门文章

  1. java IO之 File类+字节流 (输入输出 缓冲流 异常处理)
  2. vue基础01
  3. CSS预编译与PostCSS以及Webpack构建CSS综合方案
  4. Selenium模拟JQuery滑动解锁
  5. 全面理解SSD和NAND Flash
  6. UWP中使用Composition API实现吸顶(1)
  7. Android自动问题——黑屏、死机等解决方法
  8. js中this的指向总结
  9. FastDFS安装和配置,整合Nginx-1.13.3
  10. Code Complete