SOAP is a protocol with a fixed XML message format, while REST is an architectural style. SOAP wraps every call in an XML envelope, and a SOAP service usually publishes a WSDL contract. REST APIs expose resources at URLs and act on them with standard HTTP methods, usually exchanging JSON.
SOAP
REST
Kind
Protocol
Architectural style
Format
XML only
Any format, usually JSON
Contract
Usually a WSDL
Optional, often OpenAPI
Transport
HTTP, SMTP and others
Usually HTTP
Caching
Rare, since calls are usually POST
Standard HTTP caching
Security
WS-Security at the message level
TLS plus tokens such as OAuth
Choose REST for most web and mobile APIs, where lighter payloads and HTTP caching matter. SOAP still fits enterprise systems that need a formal contract or message-level security, such as older banking and insurance integrations.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why is HTTP caching common with REST but rare with SOAP?SOAP calls are usually POSTs to one endpoint, which HTTP caches skip. REST GETs on resource URLs can use Cache-Control and ETags.
What does WS-Security give you that TLS alone does not?TLS protects one connection. Message-level signing and encryption stay with the message through intermediaries and can cover parts of it.
Your new REST service must call a legacy SOAP system. How do you integrate them?Wrap the SOAP calls in an adapter that uses a client generated from the WSDL, and map SOAP faults to your own HTTP errors.
What you can say
The core difference is that SOAP is a protocol with a fixed XML message format, while REST is an architectural style, usually applied over HTTP.
With SOAP, every call is wrapped in an XML envelope, and the service usually publishes a WSDL contract that describes its operations.
With REST, you expose resources at URLs and act on them with standard HTTP methods like GET and POST, usually exchanging JSON.
That shows up in caching. SOAP calls are usually POSTs, so they rarely get cached, while REST reads can use normal HTTP caching.
Security differs too. SOAP has WS-Security at the message level, and REST usually relies on TLS plus tokens such as OAuth.
So I'd choose REST for most web and mobile APIs. SOAP still fits enterprise integrations, like older banking systems, that need a formal contract or message-level security.
Weak answers to avoid
Calls REST a protocolREST is an architectural style and SOAP is the protocol. Interviewers catch this mix-up first. Say REST usually runs over HTTP but is not HTTP itself.
Says SOAP is dead or always worseSOAP still runs many banking and insurance integrations. Say when it fits, which is when you need a formal WSDL contract or message-level security.
Says REST means JSONREST allows any format, and JSON is just the common choice. The real difference is resources at URLs with HTTP methods versus XML envelopes.
Recites a feature table with no trade-offA list of format and transport differences sounds memorized. Tie it to a choice: HTTP caching and light payloads for REST, a strict contract for SOAP.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.