+ Start a Discussion
JPClarkJPClark 

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?

 

Thanks,

Jeff

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell
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.