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
wipro.admin1.391698133027388E12wipro.admin1.391698133027388E12 

callout help

I have an callout made, where I get this error

System.callout exception :“Exceeded max size limit of 3000000 with request size 3006464

The size of an httprequest is exceeding 3MB.

The record for which I'm invoking the webservice has attachments also being sent in the http request and those attachments are causing the raise in the memory more than 3 MB as a result of whcih I'm getting the error :System.callout exception :“Exceeded max size limit of 3000000 with request size 3006464

So is there a way to zip the attachments in the Webservice code and make the callout i.e. when the webservice is invoked , the attachment should get zipped (size should reduce) and pass to the other environment.

Please help

Elie.RodrigueElie.Rodrigue
If you wont be manipulating that file in apex and you have access to the server code, then you could have the server zip the file before returning it. 

However if you plan on manipulation the file in apex then its too large. You could either get the server to split it in multiple part, or maybe get the server to actually attach it to salesforce when your http callout is made.

Can you please give us a bit more technical details of your solution so we can provide more way to solve your problem?
hramanihramani
Hi Elie,

I have an opportunity for which when clicked on save the webservice should be invoked and all the opporunity details along with the attachment attached to it should go to the other side (I call the webservice class from the trigger (@future callout)). Now since the total size of the data along with the attachment exceed 3 MB, the System.callout exception :“Exceeded max size limit of 3000000 with request size 3006464 error is being thrown. 
Now the requirement is the user could attach the file in any format but when the opportunity goes to the other side, it should go as a compressed zip file. Is it possible to zip the file in the Web service class through apex code and send it.

Note: I'm sending the attachment in 64bit encoding format

Please help.