REST Flashcards
DOM is supported by which API? Select one: a. JAX-RS b. SAAJ c. JAX-WS d. JAX-P e. JAX-B
d. JAX-P
Given the following URI, the number 15 will be passed to a method parameter annotated with \_\_\_\_\_. http://www.mysite.com/service/data/15 Select one: a. BeanParam b. PathParam c. MatrixParam d. QueryParam
b. PathParam
Given the following URI, the number 15 will be passed to a method parameter annotated with \_\_\_\_\_. http://www.mysite.com/service/data?id=15 Select one: a. QueryParam b. MatrixParam c. PathParam d. BeanParam
a. QueryParam
How are exceptions handled in REST?
Select one:
a. A web service should use HTTP error codes like 403 to show access forbidden using the Response object
b. Using faults like the way SOAP does
c. A web service should pass back an Exception object to the client
d. Exceptions should not be sent back to the client
a. A web service should use HTTP error codes like 403 to show access forbidden using the Response object
How do you consume a REST-based Web Service?
Select one:
a. Model the data provided by the service, open the endpoint using Client object, then fetch the data using the WebResource object to perform HTTP requests
b. Both of the above
c. Using the wsimport JDK command to generate the client stubs and invoke the service implementation
a. Model the data provided by the service, open the endpoint using Client object, then fetch the data using the WebResource object to perform HTTP requests
How do you expose a REST-based Web Service?
Select one:
a. Using Axis Web Service Deployment Descriptor (WSDD) format
b. Deploy the resource on a server that uses a Servlet container like Sun or Jersey APIs to direct HTTP traffic to the endpoint methods
c. Using wsgen tool in JDK and invoking Endpoint.publish(endpointURL, new ServiceImplementation( ))
d. Deploy the WSDL to the service endpoint
b. Deploy the resource on a server that uses a Servlet container like Sun or Jersey APIs to direct HTTP traffic to the endpoint methods
Session state in a REST Web Service is managed by the \_\_\_\_\_\_\_\_\_. Select one: a. Server b. Client c. ESB d. REST is stateless
d. REST is stateless
The purpose of a \_\_\_\_\_ is to locate a resource on the server hosting the REST web service. Select one: a. Request parameter b. Service endpoint c. SOAP message d. Uniform resource identifier (URI)
d. Uniform resource identifier (URI)
What annotation is used in REST to define the URI where resource can be accessed? Select one: a. WebService b. Path c. PUT d. Produces
b. Path
What class is used to build the HTTP request on the client side and submit an HTTP request to a REST service? Select one: a. Client b. GetResource c. Resource d. WebResource
d. WebResource
What is a resource in REST?
Select one:
a. A socket connection to access the Web Service
b. A database connection object for the service to access its data
c. All of the above
d. Any content accessible through the Web Service
d. Any content accessible through the Web Service
What message protocol is used in REST? Select one: a. FTP b. SMTP c. All of the above d. HTTP
d. HTTP
Which annotation is not available in REST to define the HTTP method for the annotated method? Select one: a. PUT b. TRACE c. DELETE d. GET
b. TRACE
Which is not a commonly used HTTP method in REST? Select one: a. DELETE b. OPTIONS c. TRACE d. POST e. GET f. PUT
c. TRACE
Which REST annotation specifies the Media Type that the client can send to the resource? Select one: a. Produces b. Request c. Consumes d. Path
c. Consumes