Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

What are SOAP APIs used for

Wednesday, November 9th, 2016 by Servage

SOAP-APISimple Object Access Protocol (SOAP) is not as popular as its counterpart REST. However, there are some cases where a SOAP API is preferred over REST. What kind of services might benefit from having a SOAP API instead of a RESTful one? We will find this out by getting familiar with the pros and cons of SOAP.

Advantages of SOAP

Unlike REST, SOAP is a protocol. SOAP defines its own standards, for example how messages are constructed and processed. Messages in SOAP are sent as envelopes that contain the body of the message and some metadata, such as headers. One of the advantages of SOAP is that these messages can be sent over many different protocols, including HTTP and SMTP. Both SOAP and REST support encryption over the HTTPS protocol, and this is enough to secure a connection in most cases.

In addition to HTTPS, SOAP supports multiple security modules, such as Web Services Security. WS-Security can be used verify the confidentiality of messages. It can also ensure that messages have not been tampered with while they were transferred over the Internet.

SOAP also supports built-in error handling. There is a dedicated section for errors called fault inside the message envelope. If some action causes an error, the error message can be returned inside the XML envelope to let the receiving end know that an error has occurred.

Disadvantages os SOAP

Surely there must be some disadvantages too, because SOAP is not so commonly used anymore. Firstly, it is built around the the XML format and does not support any other formats like JSON. Because SOAP sends data as XML, it is slower than JSON and uses slightly more bandwidth. In addition, using extensions like WS-Security will lower the performance of SOAP applications. WS-Security increases the length of messages, and those messages must be checked and processed to ensure they are valid. All this increases the time required to send and receive messages.

Despite the “S” in the name standing for “simple”, SOAP is not that simple after all. In fact, it is complex to implement and also complex as a concept. To build a service using SOAP, in-depth knowledge of the protocol is recommended, if not even required. Almost all the features of SOAP can also be implemented using a RESTful API.

Where is SOAP Used?

In general, SOAP is preferred for applications that require enterprise-level security. Because of the security extensions like WS-Security, SOAP can be found in online banking and business-to-business integrations where an application talks to another. For example, PayPal allows you to manage your account using their SOAP API.

What are SOAP APIs used for, 4.0 out of 5 based on 4 ratings
Categories: Tips & Tricks

Keywords: , ,

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet (leave a comment)

You are welcome to initiate a conversation about this blog entry.

Leave a comment

You must be logged in to post a comment.