メソッドコントラクトを作成しました:
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml, UriTemplate = "TestEchoWithTemplate/{message}", BodyStyle = WebMessageBodyStyle.Bare)]
string TestEchoWithTemplate(string s);
および実装方法:
public string TestEchoWithTemplate(string s)
{
return "You said " + s;
}
URLを参照すると:
http:// localhost:52587 / VLSContentService.svc / rest / TestEchoWithTemplate / HelloWorld
次のエラーが発生します。
コントラクト「IVLSContentService」の操作「TestEchoWithTemplate」には、「MESSAGE」という名前のパラメーターを予期するUriTemplateがありますが、操作にその名前の入力パラメーターはありません。
次の場合も同じエラーが発生します。
http:// localhost:52587 / VLSContentService.svc / rest / TestEchoWithTemplate / MESSAGE = HelloWorld http:// localhost:52587 / VLSContentService.svc / rest / TestEchoWithTemplate?MESSAGE = HelloWorld
私は何が間違っているのですか?