convert a WCF Service, to a RESTful application?

前端 未结 4 2068
北荒
北荒 2021-01-02 04:45

Hey im not getting anywhere with turning wcf into a restful service. So I was wondering if some one can take the basic code when you start a WCF Service application here:

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 05:19

    Use WebGet attribute on the operations you wish to be available as a RESTful service.

    Use webHttpBinding.

    Remember to add to your behaviors in config.

    Should be enough to get it started.

    EDIT:

    Add a new binding in under your service:

     
    

    etc - then further to that add

    
    

    as an endpointbehavior.

    [WebGet] attribute - look into the various options to you to further develop it.

提交回复
热议问题