Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更新的方法签名在wcf RESTful服务中不起作用_Wcf_Rest_Methods_Overloading_Fiddler - Fatal编程技术网

更新的方法签名在wcf RESTful服务中不起作用

更新的方法签名在wcf RESTful服务中不起作用,wcf,rest,methods,overloading,fiddler,Wcf,Rest,Methods,Overloading,Fiddler,我有一个这样的方法 [WebInvoke(UriTemplate = "StrDetails", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] public List<StrSearchDetails> StrDetails(string str1) { List<StrSearchDetails> details = new List<StrS

我有一个这样的方法

[WebInvoke(UriTemplate = "StrDetails", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
public List<StrSearchDetails> StrDetails(string str1)
{
    List<StrSearchDetails> details = new List<StrSearchDetails> ();
    return details;
}
[WebInvoke(UriTemplate = "StrDetails", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
public List<StrSearchDetails> StrDetails(string str1, string str2)
{
     List<StrSearchDetails> details = new List<StrSearchDetails> ();
     return details;
}
我能从小提琴手那里找到这个方法

我已经像这样更新和替换了

[WebInvoke(UriTemplate = "StrDetails", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
public List<StrSearchDetails> StrDetails(string str1)
{
    List<StrSearchDetails> details = new List<StrSearchDetails> ();
    return details;
}
[WebInvoke(UriTemplate = "StrDetails", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
public List<StrSearchDetails> StrDetails(string str1, string str2)
{
     List<StrSearchDetails> details = new List<StrSearchDetails> ();
     return details;
}
无法使用此方法。在小提琴手中抛出500个错误


有什么想法吗?

尝试更改uri模板:

[WebInvoke(uriTemplate="/StrDetails?str1={str1}&str2={str2}", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]

您如何调用该方法?Fiddler调用:。JSON主体:[{FK:TEST,SK:TEST}]URL将在backbone.js中构造