Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7190223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:28:05+00:00 2026-05-28T19:28:05+00:00

Just started my first WCF rest project and would like some help on what

  • 0

Just started my first WCF rest project and would like some help on what are the best practices for using REST.

I have seen a number of tutorials and there seems to be a number of ways to do things…for example if doing a POST, I have seen some tutorials which are setting HttpStatusCodes (OK/Errors etc), and other tutorials where they are just returning strings which contain result of the operation.

At the end of the day, there are 4 operations and surely there must be a guide that says if you are doing a GET, do it this way, etc and with a POST, do this…

Any help would be appreciated.

JD

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:28:06+00:00Added an answer on May 28, 2026 at 7:28 pm

    UPDDATE

    Use ASP.NET Web API.


    OK I left the comment REST best practices: dont use WCF REST. Just avoid it like a plague and I feel like I have to explain it.

    One of the fundamental flaws of the WCF is that it is concerned only with the Payload. For example Foo and Bar are the payloads here.

    [OperationContract]
    public Foo Do(Bar bar)
    {
        ...
    }
    

    This is one of the tenants of WCF so that no matter what the transport is, we get the payload over to you.

    But what it ignore is the context/envelope of the call which in many cases transport specific – so a lot of the context get’s lost. In fact, HTTP’s power lies in its context not payload and back in the earlier versions of WCF, there was no way to get the client’s IP Address in netTcpBinding and WCF team were adamant that they cannot provide it. I cannot find the page now but remember reading the comments and the MS guys just said this is not supported.

    Using WCF REST, you lose the flexibility of HTTP in expressing yourself clearly (and they had to budge it later) in terms of:

    • HTTP Status code
    • HTTP media types
    • ETag, …

    The new Web API, Glenn Block is working addresses this issue by encapsulating the payload in the context:

    public HttpResponse<Foo> Do(HttpRequest<Bar> bar) // PSEUDOCODE
    {
        ...
    }
    

    But to my test this is not perfect and I personally prefer to use frameworks such as Nancy or even plain ASP NET MVC to expose web API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started my first project on GeoDjango. As a matter of fact,
I have just started a new project using a Linq to Sql model and
I have just started using Ubuntu as my first Linux, have a couple of
I have just started using EF Code First to implement a simple blog. I
I just started using Hibernate on a new project, and with my first entity,
I have just started using BoneCP and this is my first time using a
We have just started using EF 4.1 code first. I have a sql query
Just started my first MVC 2.0 .net application. And I set up some default
I just started my first Mercurial project. I did a 'cd' into my source
So I just started my first rails project yesterday. I had two many-to-many (has_and_belongs_to_many)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.