PD1 Integration Architecture 4 β Questions and Answers
Question 1: A developer needs to expose a legacy SOAP service from Apex. Which annotation is used on methods to include them in the generated WSDL?
- @AuraEnabled
- @RemoteAction
- webService (Correct answer)
- @RestResource
Correct answer: webService
The `webService` keyword (not an annotation) on global methods marks them for WSDL generation in Apex SOAP services.
Question 2: An external partner needs to query Salesforce data with SQL-like syntax over HTTPS without building a SOAP client. Which API should the developer recommend?
- REST API with SOQL in query parameter (Correct answer)
- SOAP API with query() call
- Bulk API with SOQL job
- Streaming API with PushTopic
Correct answer: REST API with SOQL in query parameter
The REST API accepts SOQL via the /query resource using a simple HTTP GET, making it easy for partners without SOAP clients.
Question 3: Which integration pattern should be used when Salesforce needs to call an external system but cannot wait for a synchronous response due to processing time constraints?
- Request-Reply
- Fire-and-Forget (Correct answer)
- Batch Data Sync
- Remote Call-In
Correct answer: Fire-and-Forget
Fire-and-Forget sends a message to an external system without waiting for a response, using async mechanisms like Platform Events or @future.
Question 4: What happens if an Apex @future method that makes a callout throws an unhandled exception?
- Salesforce automatically retries the method up to 3 times
- The transaction rolls back but the callout is not retried (Correct answer)
- The callout is added to a dead-letter queue
- Salesforce sends an email to the org admin
Correct answer: The transaction rolls back but the callout is not retried
Unhandled exceptions in @future methods roll back the transaction; there is no automatic retry or dead-letter queue.
Question 5: A Salesforce org must receive large file uploads from an external system via API. Which API supports binary file uploads natively?
- SOAP API
- REST API with multipart/form-data (Correct answer)
- Bulk API 2.0
- Streaming API
Correct answer: REST API with multipart/form-data
The REST API supports multipart/form-data content type for binary file uploads, such as creating ContentVersion records.
Question 6: Which Salesforce feature automatically manages OAuth token refresh for outbound callouts, so developers do not need to handle token expiry in Apex code?
- Remote Site Settings
- Connected Apps
- Named Credentials with OAuth (Correct answer)
- Auth. Providers
Correct answer: Named Credentials with OAuth
Named Credentials configured with OAuth automatically handle token storage and refresh, so Apex code never needs to manage access tokens manually.
Question 7: An architect wants to decouple Salesforce from an external ERP so that temporary ERP outages do not cause data loss. Which integration pattern BEST addresses this?
- Synchronous REST callout on save
- Message queue / middleware (e.g., MuleSoft, Kafka) (Correct answer)
- Scheduled polling every 5 minutes
- Direct database link via JDBC
Correct answer: Message queue / middleware (e.g., MuleSoft, Kafka)
A middleware message queue buffers messages during ERP outages, ensuring no data is lost while decoupling the two systems.
A developer needs to expose a legacy SOAP service from Apex.
Which annotation is used on methods to include them in the generated WSDL?