You need to sign in to do that
Don't have an account?
Web service callout failed: String length exceeds maximum: 1000000
Hi All,
We are facing a strange issue while trying to make webservice callout and getting file content as response. Issue is that if file size is greater than 200Kb then callout is failed and throwing the exception as given below ---
"Web service callout failed: String length exceeds maximum: 1000000"
Also wondering ,it's mentioned in SF doc that max Payload size limit is 3MB for callout request as well as response.
And i am able to send data in request upto 3 MB but not able to get data as response if it's >200KB.
Can anyone suggest what need to do, or am i missing something.?
Plz help, Its URGENT.
You are using REST API, right ?
No, we are using SOAP API......
I am also facing the same issue....As far as i read through different posts....you can upload a maximum size of 3MB but u cannot download a file greater than 1 MB....
If you know a way to do it...plz post it here.
You are correct Rajjjj . You can donwload only 1 MB file. You can limit your return result , while making a callout. for example If your current query returns all the data from the object you can use some filters to limit those return results.
If you can post sample code, it will be helpfull.
Hi Rajjjj,
You can try it with HTTP callout rather than SOAP callout as i did. Using HTTP callout i was able to download/upload up to 3MB data.
I am trying Http callout only...I donno how to parse HTML response...
Do u have any idea of how to do it???????
This is the response i am getting...
I need to parse that response and get back only latitude and longitude.
If all you need is a LatLong from an address, add the google url to the security settings and use this to return the lat long. Modify as needed to store the results. The attached code is called when a SINGLE account is updated. The section starting at Account a = [Select....... is where I grab the account and populate. this is what you will need to change to store on the appropriate object.
I have a version for mapquest to as they do not have a limit on the number of calls but you have to request an API key (very easy)
I am doing this trigger on account.
I am passing that account Id and an address for now.
For now i am trying to update any value and execute that trigger.
When i am calling that future method which u have specified it is throwing me an exception that "Future method cannot be called from another future or batch method."
Here is the debug log.
It would appear that you have a natch or future method in your org that is updating the accounts and thus calling the geocode. You need to add a check int he trigger. Use the system.isFuture() == false && system.isBatch() == false to only run the geocode when the trigger is ran as a result of a non future or non-batch method
UPDATE - In my case I am only running the code if the address changes and thus when I update the account with the geocode information the @future is not called again. I see that you are running the @future each time the trigger is called. Either use the method above to not run on the update or only run in the trigger if specific conditions are met.