C# Restful Service Using WebInvoke POST method

1.4k Views Asked by At

My service is working well when i use:

[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/?id={id}")] 
string jdata(string id);

and my Method Implementation is

public string json(string id)
{
    return "Your typed String is : " id;
}

up to here it works well, but I am bound to use Method=POST in WebInvoke,

[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/?id={id}")]
string jdata(string id);

when I use this and call service, I have to face Method Not Allowed. Please resolve my this little problem....

0

There are 0 best solutions below