Skip to main content

Posts

Showing posts from February, 2018

Apex Webservice (You Call me)

I already write about Apex Call Out when we want to connect with external services either in REST or SOAP here . If Apex Call Out I use ' I call you ' metaphor to represent Salesforce need to contact external service, therefore we need external service info such as - url and set end point url in Remote Site Setting. While Apex Web Service I use ' You call me ' which mean we need to expose our Apex class either as SOAP or REST for external service to connect. You call me! In order for them to you, you need to give your phone number Expose a class as REST Service Define class with global access modifier . Use @RestResource annotation at class level to enable it serve as webservice Example : @RestResource ( urlMapping = '/Case/*' ) Define method with global static . Add an annotation to associate with Http method. Bear in mind on one method is allowed per class. It means there should be only one GET method per class . Endpoint URL that we

Apex Call out (I Call You)

Although I have done integration to external service using call out in my previous experience still I have hiccup to grab the concept.So I thought that I should sit down and learn the concept and of course  the best way is  through Salesforce Trailhead   =) . When it comes to integrate Salesforce with external service we can categorize it into two types : Apex Call Out Apex Web Service (I wrote here ) Both can use SOAP and REST protocol which it is advisable to use REST. In case you want to know which one better , please check out this article . I personally have come out easy way to understand the concept for both category.In my concept, we can assume SOAP and REST is different provider that use different format. I use 'I Call You' for Apex Call Out and 'You Call Me' for Apex Webservices. I Call You (Apex Call Out) well, can you see..my drawing is #awesome =) I mean Salesforce , You mean external service. In order to enable this we need to