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

WCF支持WebGet屬性相關(guān)應(yīng)用技術(shù)

開發(fā) 開發(fā)工具
我們今天將會在這篇文章中以一段代碼示例的解讀來為大家詳細(xì)介紹一下WCF支持WebGet屬性的實(shí)現(xiàn)方法,幫助大家獲得一些幫助。

WCF開發(fā)工具是由微軟開發(fā)的一個.NET Framework 3.5的重要組成部分。其中,它功能強(qiáng)大的優(yōu)勢在開發(fā)領(lǐng)域中占據(jù)著重要地位。在這里我們會為大家詳細(xì)介紹一下有關(guān)WCF支持WebGet屬性的相關(guān)應(yīng)用。#t#

看著別人把WCF服務(wù)和web請求結(jié)合一起用很爽,可是自己怎么也配置不出來(沒有用web host),所以研究了一下wcf的binding的配置

endpoint的 binding必須為webHttpBinding.

Endpoint的behavior中要加入webhttp.

WCF支持WebGet屬性示例配置文件如下:

 

  1. < ?xml version="1.0" encoding="utf-8" ?>   
  2. < configuration>   
  3. < system.web>   
  4. < compilation debug="true" />   
  5. < /system.web>   
  6. < !-- When deploying the service library project, the content 
    of the config file must be added to the host's   
  7. app.config file. System.Configuration does not support config 
    files for libraries. --
    >   
  8. < system.serviceModel>   
  9. < services>   
  10. < service name="Services.PlayerService" behaviorConfiguration="bh">   
  11. < host>   
  12. < baseAddresses>   
  13. < add baseAddress = "http://localhost:8731/PlayerService/" />   
  14. < /baseAddresses>   
  15. < /host>   
  16. < !-- Service Endpoints -->   
  17. < !-- Unless fully qualified, address is relative to base 
    address supplied above --
    >   
  18. < endpoint address ="" binding="basicHttpBinding" contract=
    "Contrat.IPlayerService" behaviorConfiguration="web">< /endpoint>   
  19. < !-- Metadata Endpoints -->   
  20. < !-- The Metadata Exchange endpoint is used by the service 
    to describe itself to clients. --
    >   
  21. < !-- This endpoint does not use a secure binding and should 
    be secured or removed before deployment --
    >   
  22. < endpoint address="mex" binding="mexHttpBinding" 
    contract="IMetadataExchange"/>   
  23. < /service>   
  24. < /services>   
  25. < behaviors>   
  26. < endpointBehaviors>   
  27. < behavior name="web">   
  28. < webHttp/>   
  29. < /behavior>   
  30. < /endpointBehaviors>   
  31. < serviceBehaviors>   
  32. < behavior name="bh">   
  33. < !-- To avoid disclosing metadata information, set the value 
    below to false and remove the metadata endpoint above 
    before deployment --
    >   
  34. < serviceMetadata httpGetEnabled="True"/>   
  35. < !-- To receive exception details in faults for debugging 
    purposes, set the value below to true. Set to false before 
    deployment to avoid disclosing exception information --
    >   
  36. < serviceDebug includeExceptionDetailInFaults="False" />   
  37. < /behavior>   
  38. < /serviceBehaviors>   
  39. < /behaviors>   
  40. < /system.serviceModel>   
  41. < /configuration>  

 

以上就是對WCF支持WebGet屬性的相關(guān)介紹。

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

2009-12-23 09:26:56

ADO.NET屬性

2010-03-10 13:59:40

Python異常處理

2009-12-23 17:18:45

WPF Attache

2009-12-29 10:22:34

WPF附加屬性

2009-12-29 10:11:56

WPF布局屬性

2010-01-11 15:43:06

VB.NET類屬性

2011-08-16 15:04:15

交換機(jī)快速啟動

2015-06-02 10:08:51

布線技術(shù)光纖

2011-05-30 09:17:18

光纖

2023-01-06 19:02:23

應(yīng)用技術(shù)

2010-03-11 15:01:52

Python源碼

2010-04-14 16:24:44

寬帶無線接入

2010-02-26 17:51:16

Silverlight

2009-12-21 18:10:50

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

2015-09-01 10:14:21

機(jī)房直冷優(yōu)化

2010-02-04 17:05:53

C++動態(tài)創(chuàng)建對象

2010-02-26 13:26:55

WCF消息編碼器

2009-09-03 14:14:52

RHEL ASMySQLroot密碼

2021-09-13 14:39:34

云計(jì)算Edge云應(yīng)用

2014-12-09 10:48:12

openstacknovaNUMA
點(diǎn)贊
收藏

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