Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / ASP.NET

Overcoming Size Limits in WebService Data to Avoid Web Service Call Failed Error

5.00/5 (3 votes)
3 Oct 2012CPOL 24.7K  
How to solve web service call failed error

Introduction

This tip will help you to solve web service call failed error.

Background

Sometimes when we call web service from client side, we get an error web service call failed. This is caused by too much data return in the SQL Query behind the web service call, so the web service returns an error. A simple change to the web.config file can increase the size limit of data returned.

Using the Code

Just add the following code in your web.config:

XML
<system.web.extensions>
 <scripting>
   <webServices>
      <jsonSerialization maxJsonLength="5000000" />
   </webServices>
 </scripting> </system.web.extensions>

Points of Interest

This really helped me. Hope it helps you too.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)