Search code examples
jsonspringspring-mvcrestful-architecture

Using Json payload for RESTFul web services


I am new to using Json payload to call the Restful web services using Spring in Java. I know that XML can be marshaled into java objects and vice verse using XJC compiler and JAXB. But when I use json as the input payload, how will the json data be marshalled into Java object? Please let me know also if json is the most preferred way for data exchange that XML.


Solution

  • json is faster and used to have better performance than xml, but on the other hand, xml has the metadata validation (xsd) and json doesn't