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!

link|improve this question

25% accept rate
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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