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
sdudasduda 

APEX WebService - Valid Parameters?

I am trying to create a APEX code class with a method defined as a WebService. What are the valid parameter types that I can pass to this method? I tried using a Set, but it says that it's not a valid parameter type (It doesn’t give this error if the method isn't a WebService). Are only primitive data types valid? Is it possible to pass a Set of primitive data types?

SuperfellSuperfell
primitive types, sobject's (like account, custom objects etc), classes, and arrays of these.
Sets & Maps are not supported because there's no standard SOAP serialization for these programatric structures.
SuperfellSuperfell
There's a section in docs that covers all the web service related stuff, starts at page 123 in the apex language reference doc.

http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf