私が使用すると、私のサービスはうまく機能しています:
[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/?id={id}")]
string jdata(string id);
そして私のメソッドの実装は
public string json(string id)
{
return "Your typed String is : " id;
}
ここまではうまくいきましたがMethod=POST
、WebInvoke で使用する必要があります。
[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/?id={id}")]
string jdata(string id);
これを使用してサービスを呼び出すと、 Method Not Allowedに直面する必要があります。 この小さな問題を解決してください....