SOAP is a protocol specification for executing remote procedure calls over a network. SOAP uses XML for its message formatting and data serialization, and (usually) HTTP for its network protocol.
JSON, on the other hand, is a data serialization format rather than a remote procedure call format. It is sometimes used in web services - especially services based on Representational state transfer (REST) - to pass structured data between the client and server, but it is not a remote procedure call protocol in itself.
REST, in turn, is a method for designing a web service so that its functionality is accessed the same way that HTTP works. In REST, the service is organized into resources and methods, with resources corresponding to URLs and methods corresponding to the HTTP request methods: chiefly GET, POST, PUT and DELETE.
If you want to access a resource, you issue an HTTP GET request on the URL corresponding to that resource. If you want to create a resource, you issue an HTTP POST request on the URL corresponding to that resource with the data you want to post in the request body. If you want to update an existing resource, you issue an HTTP PUT request on the corresponding URL with the updated data. If you want to delete a resource, you issue an HTTP DELETE request on the corresponding URL.
Recently, many REST web services are designed to accept request data in JSON format and to send responses in JSON as well. Since web services are mainly consumed by client programs (rather than by humans browsing), JSON allows for a generic data structure that the client can consume and parse more easily than HTML, which is designed more specifically to structure documents.
SOAP is a protocol specification for executing remote procedure calls over a network. SOAP uses XML for its message formatting and data serialization, and (usually) HTTP for its network protocol.
JSON, on the other hand, is a data serialization format rather than a remote procedure call format. It is sometimes used in web services - especially services based on Representational state transfer (REST) - to pass structured data between the client and server, but it is not a remote procedure call protocol in itself.
REST, in turn, is a method for designing a web service so that its functionality is accessed the same way that HTTP works. In REST, the service is organized into resources and methods, with resources corresponding to URLs and methods corresponding to the HTTP request methods: chiefly GET, POST, PUT and DELETE.
If you want to access a resource, you issue an HTTP GET request on the URL corresponding to that resource. If you want to create a resource, you issue an HTTP POST request on the URL corresponding to that resource with the data you want to post in the request body. If you want to update an existing resource, you issue an HTTP PUT request on the corresponding URL with the updated data. If you want to delete a resource, you issue an HTTP DELETE request on the corresponding URL.
Recently, many REST web services are designed to accept request data in JSON format and to send responses in JSON as well. Since web services are mainly consumed by client programs (rather than by humans browsing), JSON allows for a generic data structure that the client can consume and parse more easily than HTML, which is designed more specifically to structure documents.