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

How do you execute an Apex method from the API?

I have several methods in Apex classes, most of them are public static methods.

I've written C# code to move large chunks of data up to the ORG and need to call a couple of the Apex methods for the final cleanup.


I've already got a web reference using the enterprise WSDL and can create my custom objects and insert them into the ORG.


What is my next step to call into the Apex code?




Best Answer chosen by Admin (Salesforce Developers) 
You could use the executeAnonymous in the apex code web services API to call your code, or you code expose your apex code as a web service (using the webservice keyword), and then import/use the WSDL for your apex class.