您的位置:首页 > 其它

Web.Config - create WCF REST Service and host in Windows Azure

2012-08-14 21:43 525 查看
In contract PlayerData is namespace and IService1 is ServiceContract we created in previous step. Finally configuration will be as below,

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="servicebehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="restbehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name ="PlayerData.Service1" behaviorConfiguration ="servicebehavior" >
<endpoint name ="RESTEndPoint"
contract ="PlayerData.IService1"
binding ="webHttpBinding"
address =""
behaviorConfiguration ="restbehavior"/>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>


This is what all we need to do to create a WCF REST Service to be hosted on Windows Azure. Press F5 to run and test WCF Service Web Role in local development fabric. Make sure that you have set Windows Azure project as startup project.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: