WCF开发工具是由微软开发的一个.NET Framework 3.5的重要组成部分。其中,它功能强大的优势在开发领域中占据着重要地位。在这里我们会为大家详细介绍一下有关WCF支持WebGet属性的相关应用。#t#
看着别人把WCF服务和web请求结合一起用很爽,可是自己怎么也配置不出来(没有用web host),所以研究了一下wcf的binding的配置
endpoint的 binding必须为webHttpBinding.
Endpoint的behavior中要加入webhttp.
WCF支持WebGet属性示例配置文件如下:
- < ?xml version="1.0" encoding="utf-8" ?>
- < configuration>
- < system.web>
- < compilation debug="true" />
- < /system.web>
- < !-- When deploying the service library project, the content
of the config file must be added to the host's- app.config file. System.Configuration does not support config
files for libraries. -->- < system.serviceModel>
- < services>
- < service name="Services.PlayerService" behaviorConfiguration="bh">
- < host>
- < baseAddresses>
- < add baseAddress = "http://localhost:8731/PlayerService/" />
- < /baseAddresses>
- < /host>
- < !-- Service Endpoints -->
- < !-- Unless fully qualified, address is relative to base
address supplied above -->- < endpoint address ="" binding="basicHttpBinding" contract=
"Contrat.IPlayerService" behaviorConfiguration="web">< /endpoint>- < !-- Metadata Endpoints -->
- < !-- The Metadata Exchange endpoint is used by the service
to describe itself to clients. -->- < !-- This endpoint does not use a secure binding and should
be secured or removed before deployment -->- < endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>- < /service>
- < /services>
- < behaviors>
- < endpointBehaviors>
- < behavior name="web">
- < webHttp/>
- < /behavior>
- < /endpointBehaviors>
- < serviceBehaviors>
- < behavior name="bh">
- < !-- To avoid disclosing metadata information, set the value
below to false and remove the metadata endpoint above
before deployment -->- < serviceMetadata httpGetEnabled="True"/>
- < !-- 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 -->- < serviceDebug includeExceptionDetailInFaults="False" />
- < /behavior>
- < /serviceBehaviors>
- < /behaviors>
- < /system.serviceModel>
- < /configuration>
以上就是对WCF支持WebGet属性的相关介绍。
分享标题:WCF支持WebGet属性相关应用技术
当前URL:http://www.shufengxianlan.com/qtweb/news30/348830.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联