Web service
SOA (Service Oriented Architecture) Principles
A service-oriented architecture (SOA) is an architectural pattern in computer software design in...
JSON is used to store information in an organized, and easy-to-access manner. Its full form is JavaScript Object Notation. It offers a human-readable collection of data which can be accessed logically.
In this XML vs. JSON tutorial, you will learn:
XML is a markup language which is designed to store data. It's popularly used or transfer of data. It is case sensitive. XML offers you to define markup elements and generate customized markup language. The basic unit in the XML is known as an element. Extension of XML file is .xml
Here are important landmarks that form the history of JSON:
Here, are the important landmark from the history of XML:
Here is the prime difference between JSON vs. XML
JSON | XML |
---|---|
JSON object has a type | XML data is typeless |
JSON types: string, number, array, Boolean | All XML data should be string |
Data is readily accessible as JSON objects | XML data needs to be parsed. |
JSON is supported by most browsers. | Cross-browser XML parsing can be tricky |
JSON has no display capabilities. | XML offers the capability to display data because it is a markup language. |
JSON supports only text and number data type. | XML support various data types such as number, text, images, charts, graphs, etc. It also provides options for transferring the structure or format of the data with actual data. |
Retrieving value is easy | Retrieving value is difficult |
Supported by many Ajax toolkit | Not fully supported by Ajax toolkit |
A fully automated way of deserializing/serializing JavaScript. | Developers have to write JavaScript code to serialize/de-serialize from XML |
Native support for object. | The object has to be express by conventions - mostly missed use of attributes and elements. |
It supports only UTF-8 encoding. | It supports various encoding. |
It doesn't support comments. | It supports comments. |
JSON files are easy to read as compared to XML. | XML documents are relatively more difficult to read and interpret. |
It does not provide any support for namespaces. | It supports namespaces. |
It is less secured. | It is more secure than JSON. |
Let's see a sample JSON Code
{ "student": [ { "id":"01", "name": "Tom", "lastname": "Price" }, { "id":"02", "name": "Nick", "lastname": "Thameson" } ] }
Let's study the same code in XML
<?xml version="1.0" encoding="UTF-8" ?> <root> <student> <id>01</id> <name>Tom</name> <lastname>Price</lastname> </student> <student> <id>02</id> <name>Nick</name> <lastname>Thameson</lastname> </student> </root>
Here are the important benefits/ pros of using JSON:
Here are significant benefits/cons of using XML:
Here are cons/ drawback of using JSON:
Here, are cons/ drawbacks of using XML:
A service-oriented architecture (SOA) is an architectural pattern in computer software design in...
What is an API? API is the acronym for Application Programming Interface. It is a software...
What is Web Service? Web service is a standardized medium to propagate communication between the...
What is WS Security? WS Security is a standard that addresses security when data is exchanged as part of...
What is WSDL? Web Services Description Language (WSDL) is an XML-based file that basically tells...
What is SOAP? SOAP is a protocol which was designed before REST and came into the picture. The...