0

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!

1 Answer 1

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .