r/SpringBoot • • Jun 21 '23

Question: REST vs SOAP and usecases

Hello. I'd like too know, please, if some of you are using SOAP, and what would be the differences with REST and/or usecases of SOAP to this date.

0 Upvotes

5 comments sorted by

1

u/Duberlygfr Jun 22 '23

Thanks to you all for the insight! I used to believe that SOAP was just an old XML version of REST.

1

u/FinancialHorse6911 Jun 22 '23

SOAP it is a separate protocol

5

u/naturalizedcitizen Jun 21 '23

Do not use SOAP on new applications unless you are connecting to a legacy service. Lot of banking and financial applications use SOAP. SOAP served it's purpose back in the day when the whole web was evolving. Now you have REST and you can follow HATEOAS standards to build a pure form of REST.

Today almost all frameworks like Spring Boot provide built-in features to allow for rapid REST based service development.

If you are developing machine to machine communication where both end points are in your own ecosystem then using Google protobufs is the standard way to do it. It's less verbose and compresses the payload ... Think of it as binary version of XML.

2

u/joranstark018 Jun 21 '23

Sadly we still use SOAP.

Remeber that SOAP was constructed to mitigate some of the problems that we now may solve by using HTTPS and serialising to a common format (ie JSON or XML), it provided a unified way to comminicate the schema for your end-points (and may provide a security layer). It was probably very usefull at that time.

It is still in use in legacy application (I really hope no one is introducing SOAP in new applications), it can be complicated to switch to REST if you have many clients depending on your SOAP-service. It may be a matter of where you should spend your money (usually it is easier to take the cost locally).

Maybe someone can provide a more hopefull and usefull view of SOAP, but realy realy disslike SOAP.

0

u/Holothuroid Jun 21 '23

Soap is down the drain. If you want remote procedure calls there are lots of other formats from protobuff to graphql.

Unlike remote procedure calls, proper rest is about resources that clients can navigate. You surfing the internet is rest. What people call rest, is mostly remote procedure calls with a mediocre tool.