Salesforce Decode
Salesforcedecode
Back to questions
IntegrationIntermediatesoapsessionauthentication

Handle Salesforce SOAP API session timeout and automatic re-authentication

Real World Scenario

Legacy .NET integration using Enterprise WSDL fails INVALID_SESSION_ID every 2 hours stopping payroll sync mid-batch.

Expected Answer

• Central session manager refreshing login before expiry proactively • Catch INVALID_SESSION_ID fault and re-login with retry same request once • Prefer OAuth username-password or JWT over SOAP login() where policy allows • Session pooling single auth for batch workers not per-record login • Log session refresh events monitoring auth failures • Migration roadmap to REST Bulk API reducing session dependency • Secure credential storage Named Credential or vault not config file

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Stay within limits by: Central session manager refreshing login before expiry proactively. Bulkify everything — never query or DML in loops. Prefer OAuth username-password or JWT over SOAP login() where policy allows. SOAP session management is ops tax—every legacy SOAP integration needs explicit refresh handler. Balance speed of delivery with maintainability.

Architect Perspective

SOAP session management is ops tax—every legacy SOAP integration needs explicit refresh handler.