Javascript ASMX web service call - Handling Except

2019-08-13 18:41发布

问题:

I've got a web service that returns me an array of strings. I call this service from my javascript...

WebPortal.WebPortalServices.GetAllProperties(success, fail);

Now this works fine, I have my success and fail functions in my javascript. There seems to be a limit, either its the file size of the array or maybe the item count in the array, but either way when I get above 2500~ strings in the returned array the call fails. I.e my fail function is called.

How can I get the reason the service failed in my 'fail' function? I get no errors in my ASMX when I step through the service, it returns the Array of strings fine.

Thanks,

James

回答1:

function fail(arg)

{

alert("error has occured: " + arg._message);

}