自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

WCF部署于IIS相關(guān)技巧解析

開發(fā) 開發(fā)工具
如何能夠應用正確的操作方法來實現(xiàn)WCF部署于IIS呢?在這里,我們將會為大家詳細介紹一下這方面的相關(guān)應用技巧。

WCF的應用可以幫助我們打造一個安全性極高的解決方案。那么我們?nèi)绾握_使用這一工具呢?在這里我們可以先來了解一下WCF部署于IIS的相關(guān)技巧,以方便我們對此工具的應用技術(shù)有一個深入的了解。#t#

1. 安裝完 VS Extension 后,我們可以創(chuàng)建一個 WCF service 的網(wǎng)站項目。

2. 添加一個 WCF service 新項,系統(tǒng)自動會創(chuàng)建 Service.svc、App_Code\Service.cs 等必要文件。

3. 在 Service.cs 文件中完成服務編碼。

4. 添加 web.config 文件,并在其位置單擊鼠標右鍵,打開 "Microsoft Service Configuration Editor" 工具完成服務配置。

5. 注意添加 serviceMetadata,否則我們使用瀏覽器無法查看,也無法創(chuàng)建客戶端代理。

web.config 演示 (注意配置文件中并沒有提供服務地址)

  1. < ?xml version="1.0"?> 
  2. < configuration xmlns="http://schemas.microsoft.com/
    .NetConfiguration/v2.0"
    > 
  3. < system.serviceModel> 
  4. < services> 
  5. < service behaviorConfiguration="MyServiceTypeBehaviors" 
    name="MyService"> 
  6. < endpoint binding="wsHttpBinding" contract="IMyService"/> 
  7. < /service> 
  8. < /services> 
  9. < behaviors> 
  10. < serviceBehaviors> 
  11. < behavior name="MyServiceTypeBehaviors"> 
  12. < serviceMetadata httpGetEnabled="true"/> 
  13. < serviceDebug includeExceptionDetailInFaults="true"/> 
  14. < /behavior> 
  15. < /serviceBehaviors> 
  16. < /behaviors> 
  17. < /system.serviceModel> 
  18. < system.web> 
  19. < compilation debug="true"> 
  20. < /system.web> 
  21. < /configuration>service.svc  
  22. < %@ ServiceHost Language="C#" Debug="true" Service="MyService" 
    CodeBehind="~/App_Code/service.cs" %> 

建議將服務放到一個單獨的 Library 中,這樣更改宿主環(huán)境會更方便一點,不過上述步驟要做些修改。

責任編輯:曹凱 來源: 博客園
相關(guān)推薦

2009-12-21 11:19:50

WCF配置文件

2010-02-22 17:58:06

WCF異步上傳

2010-02-25 18:04:02

WCF IIS宿主

2010-02-24 11:22:04

WCF方法重載

2010-02-26 16:05:14

寄宿WCF服務

2009-12-21 18:10:50

WCF實現(xiàn)事件通知

2010-02-26 17:51:16

Silverlight

2010-02-23 10:15:22

WCF運行機制

2010-02-23 10:57:34

WCF Streami

2010-01-25 18:22:33

Android使用XM

2009-12-31 16:44:53

Silverlight

2009-12-30 09:55:51

Silverlight

2009-12-07 18:33:31

WCF Service

2009-12-22 16:03:03

WCF異常

2010-01-25 18:27:54

Android進度條

2009-12-08 16:42:48

WCF Service

2009-12-07 15:02:46

WCF學習

2010-02-22 11:25:50

WCF DateSet

2010-02-23 09:44:12

WCF dataCon

2010-02-24 12:49:39

WCF枚舉
點贊
收藏

51CTO技術(shù)棧公眾號