Loading, please wait...



Know More about Salesforce API in Cloud Computing and Integration

Integration makes the data sharing between applications easier, and Salesforce has made this job very smooth.

What is integration?

It is basically to set up a process so that various applications can share data in a diversified environment.

Easy integration with anything

Force.com has cut the pain of integrating applications. Be it on-premise applications such as Microsoft, SAP, Oracle or any third party and a cloud-based apps such as Amazon Web Service (AWS), Google App, Facebook, Twitter or any, the integration can be done smoothly. Over 50 percent of the traffic on the force.com platform comes from the system–to–system integration that makes it the most successful and strong enterprise API.

Integration Methods

Integration can be done in two ways:

  • Loose coupling
  • Tight coupling

→ APP1 < === IF 1 2 === > APP2}             →

APP1 < === IF 1 3 = = = > APP3}                ↑

→ For every integration, an explicit interface is developed

→ N( N-1 )/2

→ Eg:  10 APP’s à 10 (10-1) /2  = 45 interfaces are developed

Loose Coupling:

→ One interface  –> Connected to all applications

→ One interface n spoke architecture N applications

→ For this, there are various exclusive s/s’s

  • TIBCO
  • WEB METHOD
  • XI
  • PEGA

→ Exclusive s/w’s are very expressive

We use web services    ↓ (less expressive)

Tight Coupling

  • Web services are a set of standards that are used to implement interoperability
  • Interoperability means app’s which are working on one platform
  • Web services will set standards
  • App’s will follow standards, they will communicate with each other
  • Web services → no server here

To define standards, there are three ways

  • UDDI → Universal Descriptions Discovery & Integrations
  • SOAP → Simple Object Access Protocol
  • WSDL → Web Service Description Language

UDDI

  • It is a place of storage
  • Similar to URL

SOAP

  • An object which carries the data across the app’s and also has well-defined rules, which are present in the protocol

WSDL

  • To access the Force.com web service, you need a Web Service Description Language File (WSDL)
  • The structure of the data is defined in the WSDL

→ Web services are transported over HTTP

→ Even if WSDL is missing  data directory can be transported over HTTP

Live Ex:

UDDI → shop (recharge)

WSDL → give an explanation about the services it offers

SOAP → performs the service

Java →  J2EE specification (Sun Microsystems)

           ↓

J2EE server API → EJB

          ↓

JVM specification → J2EE API

.Net → framework

Web service → specification à API

Salesforce API

  • Provides access to web services,
  • Web services have to support 3 API

Salesforce API

→ SOAP API is used for cross-platform to integrate an organization’s data with other applications

→ Restful API is used for a small amount of data

→ Bulk API is used for large volumes of data (unlimited)

  • Data loader → implemented through the bulk API
  • In APEX we will be using SOAP API
  • DML → list → sending (or) putting data
  • List = SOQL → retrieving
Class
{
Data members
Web service static methods () {
DML list
List = SOQL
}
Global class WS test {
Integer NUM 1;
Integer NUM 2;
Web service void set values (integer n1, integer n2) {
Integer NUM 1 = n1;
Integer NUM 2 = n2;
}
Web service static integer getnum1 ()
{
Return NUM 1;
}
Web service static integer gets NUM 2 ()
{
Return num2;
}
  • Click on generate WSDL
  • Save it in the XML format on the desktop
  • Then go to Apex classes, click on generate from WSDL
  • Click on parse WSDL

Now,  you can change the name as follows:

Eg: WS test Inbound.Test

  • Generate Apex code
  • Then click on system log
  • Click on execute an inner class
  • WS test Inbound. Ws test. Stub = new

Apex web services are of two kinds

  • Inbound
  • Outbound

Inbound means it accepts data and places it in the DB

Outbound means sending data from the DB

Apex → generate WSDL → Export

  • WSDL contains something called metadata which gives complete information about the class and also helps in associating S objects
  • There are two more WSDL’s associated with SFDC

Enterprise WSDL:

This contains complete information about the SFDC data model

  • All S objects
  • Strongly typed
  • There are 3 fields say integer, decimal, string in EWSDL

Partner WSDL :

  • Same as enterprise WSDL
  • Loosely typed
  • PWSDL has only one string
  • Whenever a data model is modified while changing the structure of the S object, partner WSDL will get updated automatically, whereas EWSDL has to be generated again.
  • We can  generate directory PWSDL & EWSDL

Parse XML: 

  • Checking the structure (verification)
  • Parse XML is used to verify a WSDL, whether it is properly structured or not.

Render XML:

Creating the structure (generate)

  • Render XML creates an XML file against the speared  structure
  • (Structure → structure of the data model)
  • SF has something called metadata which describes the structure of the force.com

There are majorly 6 categories of classes in the force.com

  • Wrapper class
  • Collection class      → list → set → map
  • Exception class
  • Enum class
  • System class
  • Primitive class      → Blob

Wrapper Classes:

Classes which can be used as data types

  • They hold only a single value
  • ‘Subject’ is not a wrapper class

Enum Classes:

Enum status = (married, unmarried, divorced, widow)

  • Programmers have to define and assign data type whole variables that were declared by Enum only.

Winter’12:

  • We generally have a property called JASON
  • JASON is a format in which we shall store the objects
  • Serializable → converting object into file storage
  • DeSerializable

Conclusion

Integration makes the data sharing between applications easier, and Salesforce has made this job very smooth. Go through the details and understand how they work, apply the knowledge in a real application and check results. This piece of information would help you get a basic idea.

Related Article