You need to sign in to do that
Don't have an account?
Chitral Chadda
apexx web services and callouts
what are apex web services and callouts ,http request ?
i tried goin thru links bt couldnt undstnd , dnt post links
pls xplain in general terms so that i can hv a clear understanding of these.
i tried goin thru links bt couldnt undstnd , dnt post links
pls xplain in general terms so that i can hv a clear understanding of these.
Web services API
You have developed an application(Recruiting Apps) in salesforce , Some customers who are in PHP environment want to use it. how can they use your Apps?
For this propose you need to develope an webservice API (REST or SOAP ) so that they will access your Recruiting Apps easily.
If you develope a REST api then you need to create an endpoint url and need to give them so that they will hit the end point url and can do needful.
Go through this link
https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST
if you develop a SOAP api then you need to generate WSDL file and provide them so that they will compose wsdl file and will generate a proxy class to access your Recruit Apps.
Go through this link
http://www.salesforce.com/us/developer/docs/api/
For security propose you need to create a Connected Apps and need to give a call back url.
External Callout
You want to call an externcal application say one Payment getway you want to integrate with your apps.
In that case you need to go for call out. That means external environment will give thier webservices (Rest or SOAP) you need to call them. It is recomonded generally we integarte restfil webserivices.
Before doing call out first you need to register endpoint Url in remort site in salesforce. Then you need to write http method to call external application.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_httprequest.htm
http://blog.jeffdouglas.com/2009/03/16/restful-web-service-callout-using-post/
All Answers
Callouts - To invoke external web services. [connect with third party services]
HTTP Request - To invoke the external web services.
Web services API
You have developed an application(Recruiting Apps) in salesforce , Some customers who are in PHP environment want to use it. how can they use your Apps?
For this propose you need to develope an webservice API (REST or SOAP ) so that they will access your Recruiting Apps easily.
If you develope a REST api then you need to create an endpoint url and need to give them so that they will hit the end point url and can do needful.
Go through this link
https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST
if you develop a SOAP api then you need to generate WSDL file and provide them so that they will compose wsdl file and will generate a proxy class to access your Recruit Apps.
Go through this link
http://www.salesforce.com/us/developer/docs/api/
For security propose you need to create a Connected Apps and need to give a call back url.
External Callout
You want to call an externcal application say one Payment getway you want to integrate with your apps.
In that case you need to go for call out. That means external environment will give thier webservices (Rest or SOAP) you need to call them. It is recomonded generally we integarte restfil webserivices.
Before doing call out first you need to register endpoint Url in remort site in salesforce. Then you need to write http method to call external application.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_httprequest.htm
http://blog.jeffdouglas.com/2009/03/16/restful-web-service-callout-using-post/
thnx so much fr ur help.
it means that in webservice we let xtrnal appltnion access our data thru webservice method we define.
like if i take input as lead with fields email,name,phone and thn create account,contact ,opportunit it wud code like this
global class WebExample
{
webService static Account createRecords(Lead vLead) {
Account acc = new Account();
acc.Name = vLead.Lastname;
acc.Phone = vLead.Phone;
insert acc;
Opportunity opp = new Opportunity();
opp.Name = acc.Name+' '+'Opty Name';
opp.Amount = vLead.AnnualRevenue;
insert opp;
Contact con = new Contact();
con.FirstName = 'test';
con.LastName = vLead.LastName;
con.Email = vLead.Email;
con.Phone = vLead.Phone;
insert con;
system.debug('*********'+con);
return acc;
}
}
and in callout we use the 3rd party web services ( genraaly we use REST for this callouts)
Yeah absolutely right.
Important :
If this is what you where looking for then please mark it as a solution for others benefits.
Thank You
1 thing
global class WebExample
{
webService static Account createRecords(Lead vLead) {
Account acc = new Account();
acc.Name = vLead.Lastname;
acc.Phone = vLead.Phone;
insert acc;
Opportunity opp = new Opportunity();
opp.Name = acc.Name+' '+'Opty Name';
opp.Amount = vLead.AnnualRevenue;
insert opp;
Contact con = new Contact();
con.FirstName = 'test';
con.LastName = vLead.LastName;
con.Email = vLead.Email;
con.Phone = vLead.Phone;
insert con;
system.debug('*********'+con);
return acc;
}
}
shudnt this be
webService static Lead createRecords(Lead vLead)
rather than account
webService static account createRecords(Lead vLead)
and also
i m lil confused like on this
webService static Lead createRecords(Lead vLead)
what object we take and what do we pass in parameters