what is difference between between REST and SOAP in ServiceNow prospective?

Manikantahere
Tera Contributor

which is suitable and more secure when we prefer what?

3 REPLIES 3

Maddysunil
Kilo Sage

@Manikantahere 

Both REST and SOAP are used for integration purposes, but they differ significantly in their architecture, approach, and usage:

  1. SOAP (Simple Object Access Protocol):

    • SOAP is a protocol used for exchanging structured information in web services.
    • It typically relies on XML as the format for messages.
    • SOAP services expose a WSDL (Web Services Description Language) file, which describes the operations supported by the service.
    • SOAP messages are usually transported over HTTP, but they can also be sent over other protocols like SMTP and FTP.
    • In ServiceNow, SOAP web services can be consumed or exposed. ServiceNow supports both consuming and exposing SOAP web services.
  2. REST (Representational State Transfer):

    • REST is an architectural style for building APIs (Application Programming Interfaces) that allows systems to communicate over the internet.
    • REST APIs typically use HTTP methods like GET, POST, PUT, DELETE to perform CRUD (Create, Read, Update, Delete) operations on resources.
    • REST APIs commonly use JSON or XML for data representation, but JSON is more prevalent due to its lightweight nature.
    • Unlike SOAP, REST APIs don't require a predefined contract like a WSDL. Instead, they follow a set of principles that define how resources are accessed and manipulated.
    • ServiceNow provides extensive support for REST APIs, allowing users to consume external RESTful services, as well as exposing ServiceNow data and functionality through REST endpoints.

In summary, the main differences between REST and SOAP in the context of ServiceNow are their architectural style, message format (XML for SOAP, JSON/XML for REST), and the way services are described (WSDL for SOAP, no predefined contract for REST). REST is more lightweight and flexible compared to SOAP, making it a popular choice for modern web service integrations.

 

https://www.servicenow.com/community/developer-forum/difference-between-rest-soap-based-web-services... 

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

Amit Verma
Kilo Patron
Kilo Patron

Hi @Manikantahere 

 

Below links could be helpful :

https://www.servicenow.com/community/developer-forum/difference-between-rest-soap-based-web-services...

https://www.servicenow.com/community/developer-forum/difference-between-soap-and-rest-web-services-a...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.