REST Flashcards

1
Q
DOM is supported by which API?
Select one:
a. JAX-RS
b. SAAJ
c. JAX-WS
d. JAX-P 
e. JAX-B
A

d. JAX-P

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
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
A

b. PathParam

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
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

a. QueryParam

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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. A web service should use HTTP error codes like 403 to show access forbidden using the Response object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Session state in a REST Web Service is managed by the \_\_\_\_\_\_\_\_\_.
Select one:
a. Server
b. Client
c. ESB
d. REST is stateless
A

d. REST is stateless

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
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)
A

d. Uniform resource identifier (URI)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
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
A

b. Path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
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
A

d. WebResource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

d. Any content accessible through the Web Service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
What message protocol is used in REST?
Select one:
a. FTP
b. SMTP
c. All of the above
d. HTTP
A

d. HTTP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
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
A

b. TRACE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
Which is not a commonly used HTTP method in REST?
Select one:
a. DELETE
b. OPTIONS
c. TRACE 
d. POST
e. GET
f. PUT
A

c. TRACE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
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
A

c. Consumes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
Which REST annotation specifies the Media Type that the resource returns to the client?
Select one:
a. Consumes 
b. Path
c. Produces
d. Request
A

c. Produces