65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIconstarIconstarIcon

5.00/5 (3 votes)

Oct 3, 2012

CPOL
viewsIcon

24683

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:

 <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.