Tutorial V2.41 (Lightning)

  1. Home
  2. Docs
  3. Tutorial V2.41 (Lightning)
  4. 22. Overview of SKYVVA soap and rest api

22. Overview of SKYVVA soap and rest api

Overview of SKYVVA soap and rest API?

1.    What is a SOAP API ?

  •  SOAP is a standard communication protocol system that permits processes using different operating systems like Linux and Windows to communicate via HTTP and its XML.
  • SOAP based APIs are designed to create, recover, update and delete records like accounts, passwords, leads, and custom objects. These offers over twenty different kinds of calls that make it easy for the API developers to maintain their accounts, perform accurate searches and much more.
  • These can then be used with all those languages that support web services.
  • SOAP APIs take the advantages of making web based protocols such as HTTP and its XML that are already operating the all operating systems that are why its developers can easily manipulate web services and get responses without caring about language and platforms at all.

1.1      Explaining a Simple SOAP Example

SOAP, by its very nature, requires a little more setup, but I think you’ll be amazed at how simple it is to use. Begin this example by creating Windows Forms application using Apex. The sample code uses java, but the same technique works fine with other Apex language (you’ll need to modify the code to fit). Add labels, textboxes, and buttons as shown here (the Latitude and Longitude fields are read-only).

1.2      How to Integrate SoapUI to SKYVVA

  • Go to your Salesforce Organization

  •       Click on API.

  • Click on Generate Enterprise WSDL

  • Go to SoapUI
  • Click on SOAP
  • Create a new SOAP project

  • Save
  • SoapUI is an open source
  • User can easily download from Google.com
  • SoapUI 5.3.0 version
  • Follow easy steps of installation

 

 

                                                        

  • Right click & open

  •  Click & create a new SOAP project

  • Write your Project name
  • Browse Initial WSDL XML file

  • Click ok

  • Expand login & click “Request 1“

 

  • Delete this section its not un-useable

  • Enter your Org credetials
  • Username
  • Password + Scurity Token
  • Click on play button

Note : Refresh sessionId with 15-10 minutes because it changes frequently

  • Great you Generated sessionId successfully.

Now repeat almost same steps but this time download  SKYVVA  WSDL

 

  • Go to salesforce setup & Apex Classes in search box
  • Click Apex Classes

  • Scroll down to Iservices
  • Click & generate WSDL

  • Click on Save

 

  • Go to SoapUI
  • Click on SOAP
  • Create a new SOAP project

  • Type Project Name
  • Browse your Initial WSDL XML file
  • Click ok

  • Expand SkyvvaIServices
  • Go to integrate
  • Rename it to Authorization

  • Go back to your org
  • Create Integration & copy IntegrationID
  • Create Interface & copy Interface Name

Go to related page and create Istructure

  • Name
  • BillingCity
  • BillingCountry

  • Go to mapping section select ExtId & save

  • Go to SoapUI
  • Paste this code

<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:iser=”http://soap.sforce.com/schemas/class/skyvvasolutions/IServices”>
<soapenv:Header>
<iser:SessionHeader>
<iser:sessionId>00D7F000001bZ8f!AQEAQNjsb3J8mRbgmaxbkCVyEddn1hbyDUuFkvD.ali3CWVC0_8UIC65ek0XEvWUD410R3NM9FLG8T2Z_NL67g7PDFi1Vg7u</iser:sessionId>
</iser:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<iser:integrate>
<iser:integration>
<iser:fromSystem>a0i7F000003gJ2JQAU</iser:fromSystem>

<iser:targetObject>Test_SoapUI</iser:targetObject>
<iser:records>
<iser:oneRecord>
<iser:name>Name</iser:name>
<iser:value>Test</iser:value>
</iser:oneRecord>
<iser:oneRecord>
<iser:name>BillingCity</iser:name>
<iser:value>Mumbai</iser:value>
</iser:oneRecord>
<iser:oneRecord>
<iser:name>BillingCountry</iser:name>
<iser:value>India</iser:value>
</iser:oneRecord>
</iser:records>
</iser:integration>
</iser:integrate>
</soapenv:Body>
</soapenv:Envelope>

  • Submit

When you click on submit your code automatically transfer to salesforce Org

  • Go to your Salesforce org
  • Go to your Integration
  • Click on Message Board & press search button

2   What is REST API ?

REST is basically an architectural style of the web services that work as a channel of communication between different computers or systems on the internet. The term REST API is something else.Those application programming interfaces that are backed by the architectural style of REST architectural system are called REST APIs.

REST API compliant web services, database systems, and computer systems permit requesting systems to get robust access and redefine representations of web based resources by deploying a predefined set of stateless protocols and standard operations. By these protocols and operations and redeploying the manageable and updatable components without causing the effect on the system, REST API systems deliver fast performance, reliability, and more progression.

2.1      Explaining a Simple REST Example IntegrateBatch

 

The examples in this section use REST API resources to create, retrieve, update, and delete records, along with other record-related operations.

 

  • Open SoapUI
  • Click on REST

  • Login to your Salesforce org
  • Go to setup
  • Copy your URL

  • Paste URL here to create new REST project
  • Click ok

  • Rest project created.

  • Expand URL
  • Right click on Request
  • Click on Clone Request

  • Specify the name of cloned Request
  • Eg. Authorization
  • Click ok

Now here something is very important

  • Method POST
  • Endpoint  URL  : https://shwetatest-dev-ed.lightning.force.com
  • RESOURCE : /services/apexrest/skyvvasolutions/integrateBatch

  • Media type by default application/json where we post. (json is format)
  • Header its some tricky although its easy
  • Click on Header

  • Add header name eg. Authorization
  • Bearer is keyword after press space key
  • Paste your sessionID
  • Press enter key

 

Now go back to your salesforce org

  • Create Integration & copy IntegrationID
  • Create Interface & copy Interface Name

Scroll down to IStructure & create

  • Name
  • BillingCity
  • BillingCountry

  • Go to mapping section select ExtId & save

  • Go to SoapUI
  • Paste  this code under Media type section

 

URL     :https://shwetatest-dev-ed.my.salesforce.com

RESOURCE: /services/apexrest/skyvvasolutions/integrateBatch

{  

   “INTEGRATIONID” : “a0T6F00000USKwMUAX”,

   “INTERFACENAME” :  “test_rest”,

   “messages”: [

          {

              

                “BillingCountry”: “Cam”,

                “Name”: “Test01”,

                “BillingCity”: “PP”

           },

          {

                “BillingCountry”: “Cam”,

                “Name”: “Test02”,

                “BillingCity”: “PP”

           },

           {

                “BillingCountry”: “Cam”,

                “Name”: “Test03”,

                “BillingCity”: “PP”

           }                                                                                         

   ]

}

  • Paste the code and submit it.

  • Number Of Records”: “3”
  • Basket Name”: “IB-00000”
  • Basket Id”: “a076F00000pskGwQAI”
  • Go to your salesforce org
  • Go to your Integration
  • Click on Batch Control Board

Here is all information of our Integration Inbound processing

  • Click on view
  • Successfully saved

2.2  Explaining a Simple REST Example Create New Message

Follow the same steps to create REST project .
Go back to your salesforce org

Create an Integration & copy IntegrationID
Create an Interface & copy Interface Name

 

Scroll down to IStructure & create

  • Name
  • BillingCity
  • BillingCountry

  • Go to mapping section select ExtId & save

  • Go to SoapUI
  • Paste this code under Media type section
  • URL     : https://akash.my.salesforce.com
  • RESOURCE: /services/apexrest/skyvvasolutions/createNewMessage

 

Articles

Was this article helpful to you? Yes No

How can we help?