I am converting a WSDL to Apex and get the error 'Error: Exception class must extend another Exception class'. I understand that I can fix this by adding 'extends Exception' to the generated class. But where do I find the class that is generated and has compile errors. I am using setup-->Generate From WSDL menu.

1 Answer 1


If wsdl2apex fails with a compilation error, the generated code won't be saved, so there's no opportunity to fix the problem from that end. Instead, you'll need to either alter the WSDL to use a different name, or use the offline version (also has a convenient SFDX version here).

  • I found a simpler way to fix the compilation errors. Adding the same for the benefit of others. When using OOB wsdl2Apex functionality in SalesForce, if you see compilation error message and you think you know the way to fix the generated code, just copy the generated code from the error message window, into a notepad, fix the errors and then create a new Apex class with fixed Apex code. This worked for me.
    – Quest_sfdc
    Commented Sep 12, 2018 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .