===== REST API ===== Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services. REST is a simpler alternative to SOAP and WSDL-based Web services. REST APIs communicate over the Hypertext Transfer Protocol (HTTP) (GET, POST, PUT, DELETE) used by web browsers. === CRUD === Simple transaction methods can be mapped to HTTP messages. * **C**REATE - POST * **R**EAD - GET * **U**PDATE - PUT * **D**ELETE - DELETE === JBOSS RestEasy === http://docs.jboss.org/resteasy/docs/3.0.7.Final/userguide/html_single/index.html === JSON (JavaScript Object Notation)=== Simple XML example of a data:
The same in JSON format: {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }} ===== Rest Api Example===== 1.) Create a dynamic web project: REST_API 2.) Copy the following class: package restapi; import java.util.HashSet; import java.util.Set; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; import org.ait.rest.Restapi; @ApplicationPath("/rest") public class RestApplication extends Application { public Set