function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Luke@TWSLuke@TWS 

Max Callout Size

Getting the error:

System.CalloutException: IO Exception: Exceeded max size limit of 100000 with response size 100697

When calling my web service to bring in all of the cities/towns in Texas. Can't think of any way to make the list any smaller, having problems with a few other lists too. Anyone know of a work around for large amounts of data?



LosintikfosLosintikfos
Sorry let me get this! you trying use sforce to invoke your internal web service i believe?

If this is the case, is the callout going to have to extract Cities/Towns in Texas all the time a button or trigger is fired, or this is just a one off extract?






Luke@TWS wrote:
Getting the error:

System.CalloutException: IO Exception: Exceeded max size limit of 100000 with response size 100697

When calling my web service to bring in all of the cities/towns in Texas. Can't think of any way to make the list any smaller, having problems with a few other lists too. Anyone know of a work around for large amounts of data?






Luke@TWSLuke@TWS
It's a VF page calling the Apex service code (generated from my WSDL). It will bring in the list whenever "United States" and "Texas" is selected from two select lists.
LosintikfosLosintikfos
It is obvious the size allowed for callout has been exceeded with the value 100000 with response size 100697.

The only suggestion here will be to put LIMIT on the resultset. I think managing this effectively will stop you from exceeding at anytime.

Luke@TWSLuke@TWS
That's true, but then I will be missing some data, just annoying that this limit is in there, doing something like this in Javascript/JSON is a beeze
LosintikfosLosintikfos
Try use controls to manage the resultset!

For example 25 cities out on display at a  time, anonther 22 is pulled while the previous, hidding when the control (\/) is clicked or highlighted.
Luke@TWSLuke@TWS
Not sure if that will work as I was hoping to use the results to populate another select list. Will have a think about how I can reduce the number anyway. Thanks for the help
Ron HessRon Hess
some servers allow compression, did you try setting use compress on the http headers?
David VPDavid VP
You're returning too much data in one call but you know that already.


I'd like to add another angle at this problem : you should never present users with that much options to select from all at once ... it's just too much to read for any human being anyhow.

So, the technical solution (splitting up the choices via paging / A-B-C-D-... lists or whatever) actually will also bring you better user interface design, not too mention a quicker responding interface !
I understand that this will mean making some modifications to the webservice that's being called (do you have access to the code behind it ?) but if you do, it's worth it.

The exact same reasoning is behind the max number of results you can get from google searches (usability) or the 'queryMore' priciple in the SFDC API (performance).



rgds,


David


Luke@TWSLuke@TWS
Yes it's my webservice. It would be a pain to have a seperate UI control for the towns and cities as most counties in the UK for example only have 5-6 towns. I might look into compressing the results or just shortening the XML tags as they currently appear like:

Code:
<Results>
<LocalityId>37</LocalityId>
<Name>Dallas</Name>
</Results>
<Results>
<LocalityId>69</LocalityId>
<Name>Houston</Name>
</Results>
Thanks for the input.