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
WaihiWaihi 

Error: Number of arguments exceeds maximum: 32 (Generating an Apex class from an external wsdl)

Hi,

 

I get the above error when trying to generate an Apex class from a 3rd party wsdl.

 

Is there any way around this. The external webservice has 40 paramaters.

 

Thanks

sfdcfoxsfdcfox

This limit is set by Apex Code's limit of 32 parameters to a function call. I believe you could correct this by modifying the WSDL to have only 32 parameters per function, write in the remaining code for the last 8 parameters, and change the constructor and other related functions to accept a Map or List instead of a list of single parameters. You'll want to document that clearly in your code to make sure future developers are aware of your "hack." I'd be interested in knowing if you are able to complete this successfully.

WaihiWaihi

Thanks for your reply.

 

This solution will sit across many salesforce instances so am reluctant to hand code at this stage.

 

I'll reduce the parameter list for the moment.