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

System.CalloutException: Web service callout failed: String length exceeds maximum: 1000000

Hello everyone.


I need to call a Webservice with multiple files (base64 encoded).


As I don't like dealing with WSDL, I decided to create the following class

global class MyWSClass{
    webservice static Blob myWSMethod (List<Blob> inputs){
        return null;

 After that, I clicked on "Generate WSDL" and cleaned it a little bit (remove all headers but SessionHeader) and save it.


Then, I tried to use that WSDL to generate the Class that will use the webservice (using WSDL2Apex) that generates the following prototype.


public String myWSMethod(String[] inputs) {


The webservice works fine as long as I don't send too much information.

If I send 3 files of 300k each, it throws the following exception 


"System.CalloutException: Web service callout failed: String length exceeds maximum: 1000000"


on the line that calls to WebServiceCallout.invoke().


As the only field that depends on the files I choose is request_x and the response, I tried to change them to Blob (one, the other and both), but it didn't work.


Any idea?