简体   繁体   English

WCF Web服务在使用Jquery.ajax时导致浏览器崩溃,而数据返回为〜35k

[英]WCF Web Service causing browser to crash when using Jquery.ajax wihen data return is ~35k

I am using jquery .ajax() to call a WCFweb service. 我正在使用jquery .ajax()调用WCFweb服务。 When I call the web services sometimes my browser crash. 当我调用Web服务时,有时我的浏览器崩溃。 The code behind the WCF is working and it complies my output. WCF背后的代码正在运行,并且符合我的输出。 The output is a string. 输出是一个字符串。 The string in the case where it crash is 36236 chars long. 崩溃时的字符串长度为36236个字符。 It has a size of 35.3k. 它的大小为35.3k。 I don't think it is a timeout issue as I get the error message nearly instantaneously. 我不认为这是超时问题,因为我几乎立即收到错误消息。 When less data is returned it works. 当返回的数据较少时,它将起作用。 What could be wrong? 有什么事吗

The error message I am getting is: 我收到的错误消息是:

在此处输入图片说明

The js code is as follows js代码如下

 try {
        $.ajax({
            type: "GET",
            url: '/_vti_bin/ab/WCFAB.svc/GetDetails',
            contentType: "application/json; charset=utf-8",
            data: myid,
            success: function (msg) {
                wcfServiceGetSucceeded(msg);
            },
            error: wcfServiceGetFailed
        });
    } catch (e) {
        alert('error invoking service.get()' + e);
    }

Update 更新资料

If I limit the number of results returned it works. 如果我限制返回的结果数,它可以工作。 So it looks to be a data size issue on the returned amount. 因此,这似乎是返回量的数据大小问题。

Any crash message you are getting ? 您收到任何崩溃消息吗?

Can you check the service is not crashing for some reason. 您能否检查由于某种原因服务没有崩溃。 Replace your ajax call with a simple call and see if it work. 用一个简单的调用替换您的ajax调用,看看它是否有效。

Can you post your code here? 您可以在这里发布您的代码吗? SO that we can see the way you are calling your service. 这样我们就可以了解您调用服务的方式。

The string returned was html tags. 返回的字符串是html标签。 There was an error in the tags. 标签中存在错误。 When 100 results was returned with the error the browser could cope with it. 当错误返回100个结果时,浏览器可以解决。 When there was a large number of errors the browser broke. 当出现大量错误时,浏览器崩溃了。 Fixing the error in the html syntax meant that the brwoser rendered the page corrtectley 修复html语法中的错误意味着brwoser渲染了页面corrtectley

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM