Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a WCF service that requires POST verb. This service is hosted in a ASP.NET application on IIS 7. I have successfully confirmed that GET works, but POST does not. I have the following two operations, GET works, POST does not.

[OperationContract]
[WebInvoke(UriTemplate = "/TestPost", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
public string TestPost()
{
  return "great";
}

[OperationContract]
[WebGet(UriTemplate = "/TestGet", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
public string TestGet()
{
  return "great";
}

When I try to access TestPost, I receive a message that says: "Method not allowed".

Can someone help me configure IIS 7 to allow POST requests?

Thank you!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You will need to check your <handlers/> section in your WCF service config file to ensure that post verbs are accepted.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.