You need to sign in to do that
Don't have an account?
shrey.tyagi88@tcs.com
Salesforce Inbound Integration Pattern - Basic Questions
Hi Everyone,
I am a newbie to Salesforce Integrations and I am reading a lot of stuff to get hang of how SOAP and REST integrations are done . I have few very basic questions related to patterns , if anyone can help me out with them , that would be great. Please find them given below:
Q1. For an inbound integration, we have 2 options (as per my knowledge). One is to create an apex class and expose it as a web service , so that it can be consumed by external entity (C# or Java platform). This code will be used in whatever DML operations that are required . Second option is to ask the Java/C# side developers to write their own code and provide their code login access to salesforce by adding the application under remote side settings. How do we choose which approach to take?
Q2. While making HTTP callouts to external systems , we usedifferent type of encoding like given below:
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
String encodedPropAddress = EncodingUtil.urlEncode(Rec.a__c,'UTF-8');
How do we know which format is to be used when ? As in when to use base64 . Will it be provided to me as a salesforce developer by technicians of external systems (to which callouts are being made)?
I do know that these questions might sound to you as very basic ones , but I am bit confused . So I would really appriciate if someone can throw some light on them.
Thanks a lot for your help!!!
Regards
Shrey Tyagi
I am a newbie to Salesforce Integrations and I am reading a lot of stuff to get hang of how SOAP and REST integrations are done . I have few very basic questions related to patterns , if anyone can help me out with them , that would be great. Please find them given below:
Q1. For an inbound integration, we have 2 options (as per my knowledge). One is to create an apex class and expose it as a web service , so that it can be consumed by external entity (C# or Java platform). This code will be used in whatever DML operations that are required . Second option is to ask the Java/C# side developers to write their own code and provide their code login access to salesforce by adding the application under remote side settings. How do we choose which approach to take?
Q2. While making HTTP callouts to external systems , we usedifferent type of encoding like given below:
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
String encodedPropAddress = EncodingUtil.urlEncode(Rec.a__c,'UTF-8');
How do we know which format is to be used when ? As in when to use base64 . Will it be provided to me as a salesforce developer by technicians of external systems (to which callouts are being made)?
I do know that these questions might sound to you as very basic ones , but I am bit confused . So I would really appriciate if someone can throw some light on them.
Thanks a lot for your help!!!
Regards
Shrey Tyagi
Q2: When making callouts, use Named Credentials to store your user name and passwords instead of building them in Apex. Then you don't have to worry about authentication headers. For the UTF-8 encoding, that might be necessary for the endpoint you are calling.
All Answers
Q2: When making callouts, use Named Credentials to store your user name and passwords instead of building them in Apex. Then you don't have to worry about authentication headers. For the UTF-8 encoding, that might be necessary for the endpoint you are calling.
Well first of all , thank you very much for your quick response. I really appriciate that . So continuing with question 1 in my previous post , as per your comments we dont need any code. So if for example I need an external entity to delete an account record in my sfdc org , rather than writing the code given below:
@RestResource(urlMapping='/Account/*')
global with sharing class MyRestResource
@HttpDelete
global static void doDelete() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
Account account = [SELECT Id FROM Account WHERE Id = :accountId];
delete account;
}
I can simply configure Jitterbit with my sfdc and external app to do the job? Isn't this the same concept as workbench REST explorer , there also we just send the URL and it does the DML job in our salesforce org. We dont write any specific piece of code for that.
Thanks again for your time.
Regards
Shrey Tyagi