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
amitashtekaramitashtekar 

exposing public webservice

Hi,

 

Could anyone guide me how can I expose apex webservice to public. Which will not require any authentication.

 

Any help will be highly appreciated.

 

Thank you.

 

Regards,

Amit Ashtekar

AmulAmul

you need to write a WSDL in APEX using global variable declaration.

 

create a service like this

 

global class myService{

webservice static integer Add(integer a, integer b){

return a +b;

}

}

 

extract WSDL and generate Session Id to make a request callout.

 

please see this link:

 

http://www.sundoginteractive.com/sunblog/posts/using-apex-to-call-salesforce-web-service

 

 

Jean-NoelJean-Noel

Create a website

 

Create a public website

 

In the user permission for the public website, grant permission to your apex class.

 

Check also the permission and restriction of user link to a public website for Saleforce.