PD1 Integration Architecture 5 — Questions and Answers
Question 1: When using the Salesforce Streaming API, what is the default message retention duration for PushTopic events?
- 1 hour
- 24 hours (Correct answer)
- 72 hours
- 7 days
Correct answer: 24 hours
Salesforce retains PushTopic Streaming API messages for 24 hours, allowing replay of missed events within that window.
Question 2: A developer needs to parse a JSON response body returned from an external REST API callout in Apex. Which approach is MOST common?
- Use JSON.deserialize() with a matching Apex class (Correct answer)
- Use XML.parse() to convert JSON to XML first
- Use Database.query() to parse JSON
- Use the XMLStreamWriter class
Correct answer: Use JSON.deserialize() with a matching Apex class
JSON.deserialize() (or JSON.deserializeUntyped()) maps the JSON response body to a matching Apex class or Map structure.
Question 3: Which governor limit applies specifically to the total number of callouts (HTTP requests and web service calls) per Apex transaction?
- 10
- 50
- 100 (Correct answer)
- 200
Correct answer: 100
Salesforce enforces a limit of 100 HTTP callouts per Apex transaction across both synchronous and asynchronous contexts.
Question 4: An external system sends a SOAP request to Salesforce. Which Salesforce endpoint type handles inbound SOAP web service calls?
- Apex REST Resource endpoint
- Apex SOAP Web Service class endpoint (Correct answer)
- Salesforce Bulk API endpoint
- Flow REST endpoint
Correct answer: Apex SOAP Web Service class endpoint
Global Apex classes with `webService` keyword methods generate a WSDL and receive inbound SOAP calls at a generated endpoint.
Question 5: What is the key difference between Platform Events and PushTopic Streaming events in Salesforce?
- Platform Events are synchronous; PushTopics are asynchronous
- Platform Events are custom event-driven objects; PushTopics are based on SOQL queries against standard/custom objects (Correct answer)
- Platform Events require a WSDL; PushTopics use REST
- Platform Events can only be consumed internally; PushTopics support external subscribers
Correct answer: Platform Events are custom event-driven objects; PushTopics are based on SOQL queries against standard/custom objects
Platform Events are custom objects defined in Setup for event-driven architecture, while PushTopics use SOQL queries to stream changes on existing sObjects.
Question 6: A developer is using Apex to call a SOAP web service defined by an external WSDL. What is the first step in this process?
- Write the SOAP XML body manually in Apex string
- Use the WSDL2Apex tool to generate Apex stub classes from the WSDL (Correct answer)
- Create a Named Credential pointing to the WSDL URL
- Use HttpRequest to POST raw SOAP XML
Correct answer: Use the WSDL2Apex tool to generate Apex stub classes from the WSDL
WSDL2Apex (in Setup > Apex Classes > Generate from WSDL) generates Apex stub classes from the external WSDL, enabling typed SOAP callouts.
Question 7: Which Integration pattern describes Salesforce initiating a request to an external system and waiting for the response before completing the transaction?
- Fire-and-Forget
- Request and Reply (Correct answer)
- Event-Driven
- Batch Data Sync
Correct answer: Request and Reply
Request and Reply is the synchronous integration pattern where Salesforce calls an external system and blocks until it receives the response.
When using the Salesforce Streaming API, what is the default message retention duration for PushTopic events?