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

来源:互联网 发布:笔记本外置光驱 知乎 编辑:程序博客网 时间:2024/06/06 15:48

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.

原创粉丝点击