SOAP/API Flashcards

1
Q

What is SOAP?

A

Simple Object Access Protocol, it is an XML-based communication architecture that allows different platforms and languages to communicate through HTTP requests.
SOAP services explain the ways to interact with them via WSDL - Web Service Description Language, a language based on XML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Allowlisting?

A

Before we can make any request to an external site (doesn’t matter the kind of service), we need to allowlist it in our org.
- Setup > Security > Remote SIte Settings
and then click on New Remote Site
- Give the URL of the site, give it an alias,
and click Save
- Once this is completed, we’re able to
make an external callout to the service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Mock Classes

A
  • Apex test classes don’t let us make callouts
    to external services.
  • We need to create a response that mocks
    the one we would get as a result of the
    actual request
  • For SOAP callouts specifically, we achieve
    this by making a second test class that
    implements the WebServiceMock
    interface
  • Mock classes must be global or public and
    define the doInvoke() method, which has a
    void return type, and is also global or public
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Test.setMock() method

A
- Lets the system know which mock we're 
  using
- Takes 2 parameters
- First is the type of interface our mock 
  implements(WebServiceMock.class when 
  we’re testing SOAP callouts).
- Second is the instance of class that 
   implements this interface
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Salesforce SOAP API

A
  • Standard Out-Of-the-Box (OOB) SOAP API
    that we can use
  • Allows us to find duplicate records, execute
    queries, get information about objects and
    fields, perform DML operations, and more
    -
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

RESTful Services

A
  • Stands for Representational State Transfer
  • Set of guidelines for API architecture that
    has requirements like implementing a
    uniform interface across the service and
    the server being stateless
  • Interacting with REST services generally
    tends to be easier and more
    straightforward than interacting with SOAP
    webservices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Salesforce REST API

A
  • Standard REST API that they provide
  • Can use it to execute queries, get
    information about objects and fields,
    perform DML operations, and more
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

OOB Salesforce APIs

A
  • Bulk API
  • Chatter REST API
  • User Interface API
  • Analytics REST API
  • Tooling API
  • Metadata API
  • Streaming API
How well did you know this?
1
Not at all
2
3
4
5
Perfectly