我创建了一个接受用户输入并点击'submit'的html页面,向我的机器上运行的WCF Web服务发送一个ajax请求(GET)。 用户输入可以从100个字符变为1000个字符。直到用户输入500个字符或更少(网址长度< 560)时,我才能获得完美结果。但是,只要输入长度超过500个字符(网址长度= 560),就会出现错误 - 400 - 错误请求。针对较长的URL的400BAD请求(ajax)
我已经改变了Web配置文件,如下我的web服务:
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
等...
但我仍然得到同样的错误输入>从HTML页面500
Ajax请求:
$.ajax({
type: 'GET',
cache: false,
timeout: 600000,
crossDomain: true,
url: 'http://localhost:53518/RestServiceImpl.svc/json/' + inputData,
success: function (response) {
var tableData = response.GetInventoryDataResult;
populateTable(tableData);
}
else
{
$('#demotable').show();
alert("No data found for the entered SerialIDs.");
}
},
error: function (jqXhr, statusText, errorThrown) {
console.log("readyState:" + jqXhr.readyState + "responseText:" + jqXhr.responseText + "StatusCode:" + jqXhr.status + "statusText:" + jqXhr.statusText);
}
});
请建议。 我是否需要对接收GET请求的wcf服务的web.config文件进行更改? 请注意:代码工作完全正常较小的URL
2017-08-10
ashwani