+ Start a Discussion

Return bulk records from custom apex web service

I need to develop a custom web service which might return high volume of data. what is max reponse size limit 3MB? If I have to return more than the limit what would be the easiest way. I am using SOAP.


Thanks in advance.


The max. size of the response (or incoming request) is 3MB when developing a custom Apex SOAP service. There is unfortunately no way around that limit. You could however add custom pagination logic in your custom web service and in effect implement the query/queryMore pattern that the standard Force.com SOAP API does. This will require you to make multiple calls to the custom web service to get back all the data, but there really is no way around that.

Check out this cool blog entry that describes the custom pagination approach - http://nickhamm.com/how-to-use-an-apex-webservice-to-pull-more-th. Hope this helps.