Note that there are some explanatory texts on larger screens.

plurals
  1. POPrototype AJAX Post Parameters missing randomly
    text
    copied!<p>Alright, so i have a .NET application that uses the Prototype library to make AJAX calls to webmethods in the page-behind to retrieve data. This application has been up and running for quite awhile with no issues. Recently a new user began using the application and experiencing some weird issues.</p> <p>Basically, what happens is he can use the application fine for awhile and then it just starts throwing errors on AJAX calls stating parameters are missing to the webmethod. Here is the error:</p> <pre><code>System.InvalidOperationException - Unable to perform the requested action: Invalid web service call, missing value for parameter: 'fleet'. at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary'2 parameters) at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary'2 parameters) AT SYSTEM.WEB.SCRIPT.SERVICES.RESTHANDLER.INVOKEMETHOD(HTTPCONTEXT CONTEXT, WEBSERVICEMETHODDATA METHODDATA, IDICTIONARY`2 RAWPARAMS) at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData) </code></pre> <p>It isn't just one call that messes up but any ajax call randomnly and it always seems to be the first parameter in the webmethod that is called "missing." leading me to believe the post data isn't gettin back somehow? (related?: <a href="https://stackoverflow.com/questions/6941898/jquery-ajax-post-parameters-sometimes-not-sent-on-ie">JQuery Ajax post parameters sometimes not sent on IE</a>).</p> <p>I have never been able to recreate this issue, nor has any other user experienced it. This leads me to believe it is something specific on this users system that is causing the issue. Unfortunately they are a rather important user so i need to attempt to solve this problem. The user has IE8 as their browser. Here is the code that makes the ajax call using prototype:</p> <pre><code>function gAjax(url, params, onSuccess, onError, onException, onComplete) { new Ajax.Request(url, { method:'post', //Post contentType:"application/json; charset=utf-8", //As JSON postBody:Object.toJSON(params), //Post Body is JSON string sanitizeJSON:true, //Sanitize the JSON onComplete:onComplete, //Set user on complete onSuccess:onSuccess, //Set user on success onFailure:onError, //Set user on error onException:onException //Set user on exception }); } </code></pre> <p>onComplete, onSuccess, onError, onException are function callbacks. params is an object like the following:</p> <p>{'fleet':'fleetVal','bin':1234}</p> <p>Url is the method, such as Bin.aspx/LoadBinInfo. This method is defined in the backend as follows:</p> <pre><code> &lt;System.Web.Services.WebMethod()&gt; _ Public Shared Function LoadBinInfo(ByVal fleet As String, ByVal bin As Integer) As Dictionary(Of String, Object) '..... 'Returns a dictionary of info End Function </code></pre> <p>If anyone has any ideas as to what is happening i would greatly appreciate any input! I can't seem to find any information in my research to lead me to the possible cause. Again it seems to only happen to this one user, so maybe its a browser setting on his end (any ideas what setting?). But then again its sporadic for him even, but once it starts happening it happens constantly until he closes out the browser and starts over.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload