0

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.

0

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).

1
  • 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
    Sep 12 '18 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.