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 6797193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:34:46+00:00 2026-05-26T18:34:46+00:00

I have a WCF Service and I am able to GET from it but

  • 0

I have a WCF Service and I am able to GET from it but I can’t work out how to PUT to it. I just want to increment a hits field each time the record is used in the client. Here is some of my code.

Interface:

[OperationContract]
[WebInvoke(Method = "PUT",
    ResponseFormat = WebMessageFormat.Json,
    BodyStyle = WebMessageBodyStyle.Wrapped,
    UriTemplate = "IncSMS")]
void IncSMS();

Method:

public void IncSMS()
{
    var business =
        (from p in _db.Businesses
            where p.BusinessID == 1
            select p).FirstOrDefault();
    business.SMSHits += 1;
    _db.SaveChanges();
}

I’m getting “Method not allowed.” In IE, can anyone see what I’m doing wrong???

Cheers,

Mike.

  • 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-26T18:34:46+00:00Added an answer on May 26, 2026 at 6:34 pm

    Well, I asked the question and it took me three days to find the answer to something that should have been very simple.

    So the question ended up being: How do I add a Content-Length header to my request???

    Answer: You can’t add Content-Length to a URI when typed into a browser, “because by default it will perform a GET”!!! To add Content-Length to your header you must use a debugging tool, e.g.. Fiddler or build a form or some other type of client!

    In fiddler you simply type Content-Length: 0 in the “Request Headers” section of the “Request Builder” and it will magically work! As seen near the bottom of this tutorial: http://blog.donnfelker.com/2008/12/04/how-to-rest-services-in-wcf-3-5-part-2-the-post/

    Thanks guys,

    Mike.

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

Sidebar

Related Questions

I have a WCF Service that I want my client to be able to
I have a WCF service that I can debug. I put a breakpoint in
I'm working with a WCF web service project and using log4net, but can't get
I'm new here and I hope anyonte can help me. I have WCF Service
I have a WCF service that can return large amount of data depending on
I have a WCF Service Using MSMQ hosted on IIS. I want to create
Hey I have made an WCF service and would like to be able to
We are using Dtos in our WCF service interface, but have started to come
I have a service with windows authentication. Using the following code, I can get
I have a WCF service that is: Using the BasicHttpBinding (if you can answer

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.