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
vkernelvkernel 

Invoke function from external PHP

Hi!

Is it any way to invoke receive results from function (I've created class with static function, I can invoke it from other classes and trigers, but I can't find how to do it from external php aplication)?

Thanks in advance.
werewolfwerewolf
You'll have to define that Apex method as a webService, and then you can call it from PHP using the execute verb.  There's some analog of it (albeit using Javascript, not PHP) on page 67 of the Force.com Cookbook.
werewolfwerewolf
Strike that -- reverse it.  Well, I guess the PHP toolkit doesn't support an execute method like the AJAX toolkit does.  As such, you'll have to generate the WSDL file from your Apex web service by following the instructions here:

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_web_services_methods.htm#kanchor464

From there you'll need to use your favorite PHP WSDL consumer tool to make PHP stub classes out of the WSDL.  I've used NuSoap before, it worked pretty well, although my PHP skills are fast becoming out of date...
SoleesSolees

Could you please post an example of the Server Side WebService using NuSoap, the WSDL and the Apex Code to execute it.  Thanks