Generally, REST is preferred due to its simplicity, performance, scalability, and support for multiple data formats.
However, SOAP is favorable to use where service requires an advanced level of security and transactional reliability.
But you can read the following facts before opting for any of the styles.
Does the service expose data or business logic? REST is commonly used for exposing data while SOAP for logic.
The requirement from clients or providers for a formal contract. SOAP can provide contract via WSDL.
Support multiple data formats.
Support for AJAX calls. REST can apply the XMLHttpRequest.
Synchronous and asynchronous calls. SOAP enables both synchronous/ asynchronous operations whereas REST has built-in support for synchronous.
Stateless or Stateful calls. REST is suited for stateless operations.
Security. SOAP provides a high level of security.
Transaction support. SOAP is good at transaction management.
Limited bandwidth. SOAP has a lot of overhead when sending/receiving packets since it’s XML based, requires a SOAP header. However, REST requires less bandwidth to send requests to the server. Its messages are mostly built using JSON.
Ease of use. REST based application is easy to implement, test, and maintain.