Webservices-interfaces: SOAP and RESTful

In this technical contribution we would like to compare the webservice-interfaces SOAP and REST. webPDF provides its PDF-functions as SOAP as well as RESTful-webservices. But how do the SOAP and RESTful methods differ and what are the advantages and disadvantages?

When it comes to software development, the keyword API or RESTful API is often used. Since APIs are regarded as the foundation of software development, it is worth taking a look behind the scenes to understand what this is all about. API means Application Programming Interface in this context.

Interfaces enable communication and interaction between two systems. In addition to the design, the development of a website also includes the concept of an API (including an understandable documentation for it). And for this work certain standards have established themselves (protocols) with which every API designer works. One of these best known protocols is SOAP, for example.

Comparison of webservice-interfaces: SOAP & RESTful

SOAP (Simple Object Access Protocol) REST (Representational State Transfer)
network protocol REST is considered a software architecture style / construction method for the Web
Field of application: SAP, use in Enterprise environment Field of application: Web / Use with public Web APIs
SOAP is a standard of the World Wide Web Consortium (W3C). SOAP is based on XML and Internet protocols for the transmission of messages. As a rule, a combination of SOAP with HTTP and TCP is used. Characteristically, the REST design works in such a way that communication is on demand. The resources, which are the desired objects of the application, each have an individual URI (Uniform Resource Identifier) with which they can be identified.
Stateless webservices: In comparison to RESTful, SOAP is often referred to as stateless. This means that information is provided completely with every request and is then forgotten again. The classic example is the HTTP protocol: When a browser requests a webpage from a webserver, the webserver delivers the content and then reverts to a “stateless condition” without any memory. Each new request from the client requires a new connection setup and data retrieval. By combining SOAP with HTTP, SOAP is often referred to as stateless. (It must be said that even a stateless http protocol can have cookies that allow stateful transactions). Stateless webservices in general are considered easy to develop and more scalable. Stateful webservices: Unlike SOAP, stateful webservices mean that the server stores information about the client and can use this information within a series of requests. Such a stateful webservice is session-oriented, which means that you can save resources and increase speed when transmitting larger amounts of data. Example of a stateful webservice: Checkout process for an Online-Shop. Stateful means here: The data is available on every page over the entire session. This may lead to a heavy load on the server/ The programming is considered to be easier in this case.
Disadvantages of SOAP: It brings an additional overhead (a lot of metadata) through XML (can affect performance). The assembly of XML messages is computation-intensive and the WS standard has become very confusing over time. Advantages of REST: REST, like SOAP (or WSDL and RPC), is mainly used for communication between machines. REST has proven to be particularly helpful here, as it does not encode method information, unlike SOAP. One can easily orient oneself on the already existing web-infrastructure.
Advantages of SOAP: It is considered intuitive and offers enormous freedom in implementation, yet it is very complex. It offers generally accepted standardization, platform independence and scalability.

 

Disadvantage of REST: In contrast to SOAP, there is a lack of standardization, which can cause misunderstandings. Advantage: RESTful is particularly suitable when it comes to receiving and displaying data. In addition, RESTful is very easy to implement. Another positive side effect is that the client can send the calls to different servers, depending on the load. The main advantages here are the independence of the clients and the comfortable scalability of the services. REST can always be used independently of the implementation technology used by the server and is preferred for the development of mobile APIs. The compatibility with the existing web-infrastructure makes the use of REST particularly modern and future-proof.

 webPDF 6.0: SOAP or RESTful – Technical details

In summary one can say that it depends on the respective individual case to decide whether one would like to use SOAP or RESTful. Since both methods have advantages and disadvantages, webPDF offers both! Because webservices are conceivable for the most different application scenarios and have an open and flexible architecture, which makes them independent of platforms, programming languages or protocols. They allow you to avoid licensing costs and use webservices very flexibly in many places. So it makes sense to choose SOAP or RESTful depending on the case.

Webservice-interfaces for webPDF:

SOAP RESTful
webPDF 6.0 provides its interfaces as SOAP-webservices according to the “Java Specification Request (JSR) 224”. The description of the interface is provided as “Web Services Description Language (WSDL)”. The webPDF-server provides the SOAP-webservices based on “JAX-WS 2.2” and the “JAX-WS Reference Implementation (RI) Project” in the version 2.2.8. The webPDF-server provides a number of SOAP-webservices with different SOAP methods. webPDF 6.0 offers its interface as RESTful-webservices according to the “Java Specification Request (JSR) 311“. The provision is based on the web-standards and the HTTP protocol. The functions of webPDF are made available as REST (Representational State Transfer) resources and can be accessed via a Uniform Resource Identifier (URI). The resources are displayed in JSON. The webPDF-server enables the RESTful-webservices based on JAX-RS 2.0 and the Jersey-reference-implementation. The URIs of the webservices can be executed using the HTTP methods PUT, GET, POST and DELETE.

webPDF-webservices

webPDF offers all PDF functions as SOAP or RESTful webservices. Webservices are extremely convenient because they can be used platform-independently. In addition, the webservices can be integrated into programming languages. For both SOAP and RESTful, the webPDF server provides a total of six webservices. With these you can use the PDF functions provided by webPDF. More about the PDF-webservices.

The webservices enable the following editing-functions:

  1. file conversion to PDF format
  2. digital signing
  3. conversion to PDF/A and validation of existing PDF/A documents
  4. further processing of the PDF documents (sharing, saving, graphic export, printing)
  5. URL conversion: HTML content is called up via URL and converted into PDF documents.
  6. optical text recognition (OCR) of graphic documents and their conversion to PDF

Note: Individual parameters exist for each webservice. The parameters can be used to control the behavior and execution of the webservices. The parameters are identical, regardless of whether you use SOAP or RESTful webservices.