"Error: Sys.Net.WebServiceFailedException: The server method failed with the following error: -- There was an error processing the request."

Posted on 2010-09-21
Last Modified: 2012-05-10
I have a web application in which a JavaScript call is made to a web service which is written in VB.  The web service accesses a data set which is in a session variable and returns it as XML.  For most users the returned XML is a few thousand characters but for some it can be over 800,000.  The error in the title occurs when the XML is somewhere over 55,000 characters.  The error occurs in the depths of the auto generated JavaScript so I haven't had much luck debugging it however it is apparent that there is a default limit on the size of the string returned by web services.  I searched the web and found some things about disabling SOAP and setting the JSON size limit in web.config but that didn't work for me.  The code for the JavaScript and the web service are below.  Any suggestions would be greatly appreciated.
function PopulateRecordsFor() 






    catch (e) 


        alert("Alert 1" + e.description);



function PopulateRecordsForCallBack(result)


    try {

        var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

        xmlDoc.async = "false";


        var xmlname, xmlid

        var findNodes1 = xmlDoc.getElementsByTagName("Name");

        var ddl = $get("ctl00_ddlRecordsFor");

        for (i = 0; i < findNodes1.length; i++) {

            xmlname = xmlDoc.getElementsByTagName("Name")[i].childNodes[0].nodeValue;

            xmlid = xmlDoc.getElementsByTagName("FileNumber")[i].childNodes[0].nodeValue;

            var objOption = document.createElement("option");

            objOption.value = xmlid;

            objOption.text = xmlname;




    catch (e) 


        alert("Alert 2" + e.description);



Imports System.Web

Imports System.Web.Services

Imports System.Web.Services.Protocols

Imports System.Data

Imports System.Collections.Generic

<System.Web.Script.Services.ScriptService()> _

<WebService(Namespace:="")> _

<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _

Public Class RecordsForService

    Inherits System.Web.Services.WebService

    <WebMethod(EnableSession:=True)> _

    Public Function PopulateList() As String


            Dim ds As DataSet = Session("CurrentUser").Individuals

            Return ds.GetXml()

        Catch ex As Exception

            Return "The following error has occurred on the Core Information form while attempting to populate the Records For list.' " _

             & ex.Message & "' Copy and paste this message into an e-mail to the IT help " _

             & "desk or call the IT help desk and read this exact message to them."

        End Try

    End Function

End Class

Open in new window

Question by:leskelly

Accepted Solution

leskelly earned 0 total points
ID: 33735308
I re-posted this with different title and got the answer.  For any one interested the answer is in question ID: 26491250.

Expert Comment

ID: 34388602
I need the following ID: 26491250 to check the soloution.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now