简体   繁体   English

如何使用[webinvoke]将大型json字符串传递到Web服务

[英]how to pass large json string to web service using [webinvoke]

I have a problem passing a large JSON string to a web service from the client side with a jQuery function. 我在使用jQuery函数将大型JSON字符串从客户端传递到Web服务时遇到问题。 When the lenth of the string increases to 1000 characters, the web service throw an exception "Unspecified Network Error". 当字符串的长度增加到1000个字符时,Web服务将引发异常“未指定的网络错误”。 Please let me know how to pass a large JSON value to a web service using [webinvoke]. 请让我知道如何使用[webinvoke]将较大的JSON值传递到Web服务。

Can we increase the size of url or whatever to fix this problem? 我们可以增加url的大小或解决此问题的方法吗?

You can serialize your Json as object: 您可以将Json序列化为对象:

page.asp page.asp

var data1 = {
       IdTest: ('<%= miAspVar %>'),
       fono: telefono,
       etc, etc
};
var strData = YAHOO.lang.JSON.stringify(data1)

callService(testLlamada, strData, EstadoLlamada, onError2);

function onError2(result) {
    alert(result);
}

function EstadoLlamada(result) {
...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将大量数据传递给Web服务 - How to pass large quantity of data to web service 如何在Soap Web服务中使用查询字符串传递参数? - How to pass parameters using Query string in a Soap web service? WebInvoke返回带有额外引号的Json字符串 - WebInvoke return Json string with extra quotes WCF REST服务:具有JSON和多态的WebInvoke无法正常工作 - WCF REST Service: WebInvoke with JSON and polymorphism does not work correctly 如何将带有$ ajax的JSON参数传递给asmx Web服务 - How to pass JSON parameter with $ajax to asmx web service 接收Web api方法使用HttpClient接受强类型参数时,如何传递JSON字符串? - How to pass JSON string when receiving Web api method is accepting strongly typed parameter using HttpClient? 如何将字符串从Web服务传递到Windows窗体应用程序? - How to pass a string from web service to windows form application? 如何通过Jquery将数组字符串[]传递给Web服务? - how do you pass an array string[] to a Web Service via Jquery? 如何通过JQuery将字符串参数传递给Web服务中的webmethod - how to pass string parameter to webmethod in a web service from JQuery MonoDroid:从Web服务读取大json字符串时间歇性失败 - MonoDroid : Intermittent failure when reading a large json string from web service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM