REST interview
1) What is REST and RESTful web services?
2). What is difference between RESTful web service and SOAP web service?
3). What is restlet framework?
4). What is resource in rest framework?
5). Can we use restlet without any web container?
6). What is RESTEasy?
7). What are the tools used for creating restful web services?
8). How to dispay custom error pages using Restful web services?
9). Which HTTP methods are supported by Restful web services?
10). What is difference between top down and bottom up approach of developing web services?
11). What happends if restful resources are accessed by multiple clients? Do you need to make it thread safe?
What is REST and RESTful web services?
- REST stands for representational state transfer.
- it is a relatively new concept of wiring web services which enforces stateless client server design where web services are treated as resource and can be accessed and identified by there URL unlike SOAP web services which were defined by WSDL.
- in restful web services http methods like GET,PUT,POST and DELETE can be used to perform CRUD operations.
What is difference between RESTful web service and SOAP web service?
- rest is more easy and simple to use than soap
- rest uses http protocol for producing or consuming web services while soap uses xml
- rest is lightweight as compared to soap and preferred choice in mobile devices and PDAs.
- REST support different format like text,json and xml while soap only support xml.
- rest web service call can be cached to improve performance.
What is restlet framework?
- is leading restful web framework for java applications is used to build restful web services.
- it has two parts: restlet api and restlet implementation much like servlet specificiation.
- there are many implementation of restlet framework available, you just need to add there jar in your classpath to use them.
- by using restlet web framework you can write client and server.
What is resource in rest framework?
- it represents a resource in REST architecture.
- on RESTLET API it has life cycle methods like init(), handle() and release() and contains a context, request and response corresponding to specific target resource.
Can we use restlet without any web container?
- yes, restlet framework provides default server which can be used to handle service request if web container is not available.
What is RESTEasy?
- is another REST framework introduced in JBoss application server.
What are the tools used for creating restful web services?
- you can use AJAX and direct web removing to consume web services in web application.
- both eclipse and netbeans also support development of restful services.
How to dispay custom error pages using Restful web services?
- in order to customize error, you need to extend statusservice and implement getRepresentation(Status, Request, Response) method with your custom code now assign instance of your customstatusservice to appropriate statusservice property.
Which HTTP methods are supported by Restful web services?
- in Restful web service, each resource supports GET, POST, PUT and DELETE http methods.
- GET mapped to represent()
- POST acceptRepresentation()
- PUT storeRepresentation
- DELETE: remove representation
What is difference between top down and bottom up approach of developing web services?
- in top down approach first WSDL document is created and then Java classes are developed based on WSDL contract.
- so if WSDL contract changes, you got to change your java classes while in case of bottom up approach of web service development you first create java code and then use annotations like @webservice to specify contract or interface and WSDL field will be automatically generated from your build.
What happens if restful resources are accessed by multiple clients? Do you need to make it thread safe?
- since new resource instance is created for every incoming request, there is need to make it threadsafe or add synchronization.
- multiple clients can safely access restful resources concurrently.
1) What is REST and RESTful web services?
2). What is difference between RESTful web service and SOAP web service?
3). What is restlet framework?
4). What is resource in rest framework?
5). Can we use restlet without any web container?
6). What is RESTEasy?
7). What are the tools used for creating restful web services?
8). How to dispay custom error pages using Restful web services?
9). Which HTTP methods are supported by Restful web services?
10). What is difference between top down and bottom up approach of developing web services?
11). What happends if restful resources are accessed by multiple clients? Do you need to make it thread safe?
What is REST and RESTful web services?
- REST stands for representational state transfer.
- it is a relatively new concept of wiring web services which enforces stateless client server design where web services are treated as resource and can be accessed and identified by there URL unlike SOAP web services which were defined by WSDL.
- in restful web services http methods like GET,PUT,POST and DELETE can be used to perform CRUD operations.
What is difference between RESTful web service and SOAP web service?
- rest is more easy and simple to use than soap
- rest uses http protocol for producing or consuming web services while soap uses xml
- rest is lightweight as compared to soap and preferred choice in mobile devices and PDAs.
- REST support different format like text,json and xml while soap only support xml.
- rest web service call can be cached to improve performance.
What is restlet framework?
- is leading restful web framework for java applications is used to build restful web services.
- it has two parts: restlet api and restlet implementation much like servlet specificiation.
- there are many implementation of restlet framework available, you just need to add there jar in your classpath to use them.
- by using restlet web framework you can write client and server.
What is resource in rest framework?
- it represents a resource in REST architecture.
- on RESTLET API it has life cycle methods like init(), handle() and release() and contains a context, request and response corresponding to specific target resource.
Can we use restlet without any web container?
- yes, restlet framework provides default server which can be used to handle service request if web container is not available.
What is RESTEasy?
- is another REST framework introduced in JBoss application server.
What are the tools used for creating restful web services?
- you can use AJAX and direct web removing to consume web services in web application.
- both eclipse and netbeans also support development of restful services.
How to dispay custom error pages using Restful web services?
- in order to customize error, you need to extend statusservice and implement getRepresentation(Status, Request, Response) method with your custom code now assign instance of your customstatusservice to appropriate statusservice property.
Which HTTP methods are supported by Restful web services?
- in Restful web service, each resource supports GET, POST, PUT and DELETE http methods.
- GET mapped to represent()
- POST acceptRepresentation()
- PUT storeRepresentation
- DELETE: remove representation
What is difference between top down and bottom up approach of developing web services?
- in top down approach first WSDL document is created and then Java classes are developed based on WSDL contract.
- so if WSDL contract changes, you got to change your java classes while in case of bottom up approach of web service development you first create java code and then use annotations like @webservice to specify contract or interface and WSDL field will be automatically generated from your build.
What happens if restful resources are accessed by multiple clients? Do you need to make it thread safe?
- since new resource instance is created for every incoming request, there is need to make it threadsafe or add synchronization.
- multiple clients can safely access restful resources concurrently.
No comments:
Post a Comment