Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
Jquery 部署到AppHarbor后,WebInvoke表单元素为空_Jquery_Wcf_Appharbor - Fatal编程技术网

Jquery 部署到AppHarbor后,WebInvoke表单元素为空

Jquery 部署到AppHarbor后,WebInvoke表单元素为空,jquery,wcf,appharbor,Jquery,Wcf,Appharbor,我使用Jquery发布WCF服务 它在我的开发环境中运行良好,但是发布的值在部署到AppHarbor的服务器上无法检索 服务的定义如下: [OperationContract] [WebInvoke(Method="POST", UriTemplate="/RunReport/MyReport", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] WebResults MyReport(

我使用Jquery发布WCF服务

它在我的开发环境中运行良好,但是发布的值在部署到AppHarbor的服务器上无法检索

服务的定义如下:

[OperationContract]
[WebInvoke(Method="POST", UriTemplate="/RunReport/MyReport", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
WebResults MyReport();
public WebResults MyReport()
{
var value = HttpContext.Current.Request.Form["formName"];
...
}
在实现中,我得到如下值:

[OperationContract]
[WebInvoke(Method="POST", UriTemplate="/RunReport/MyReport", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
WebResults MyReport();
public WebResults MyReport()
{
var value = HttpContext.Current.Request.Form["formName"];
...
}
实现类还具有以下属性:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
正如我所说,这在本地运行良好,我可以看到Firebug中的jquery发布了正确的数据,但由于某些原因,AppHarbor HttpContext.Current.Request.Form[“formName”]总是返回NULL


有什么想法吗?

我不确定问题出在哪里,但我找到了一个解决办法

我现在使用以下代码,它似乎可以工作:

StreamReader reader = new StreamReader(stream);
String res = reader.ReadToEnd();
NameValueCollection coll = HttpUtility.ParseQueryString(res);
criteria.Retailers= coll["Retailers"].Split('|');
我在这篇帖子上找到了答案: