0% found this document useful (0 votes)
16 views23 pages

RestfulQB s3

The document contains a series of questions and answers related to RESTful web services, HTTP methods, and JSON data formats. It covers topics such as HTTP status codes, CRUD operations, AJAX calls, and JAX-RS implementations. Additionally, it discusses the differences between PUT and POST methods, as well as the structure of RESTful APIs and client-server interactions.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views23 pages

RestfulQB s3

The document contains a series of questions and answers related to RESTful web services, HTTP methods, and JSON data formats. It covers topics such as HTTP status codes, CRUD operations, AJAX calls, and JAX-RS implementations. Additionally, it discusses the differences between PUT and POST methods, as well as the structure of RESTful APIs and client-server interactions.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
You are on page 1/ 23

SNO QFLAG QTEXT a b

Name the protocol which is


1 used by RESTful web services JSON HTTP

Which of the following HTTP


Status code means OK
REQUEST, states that valid
2 input is provided? 201 200
REST service end point starts with http:// and starts with http:// and
3 comprises an address. ends with ? ends with &

PUT maps to Create,


PUT maps to update, GET GET maps to Retrieve,
Define One-to-one Mapping maps to Retrieve, POST POST maps to Update,
Between Http Methods And maps to create, DELETE DELETE maps to
4 Crud? maps to Delete. Delete.

$.ajax({
$.ajax({ type: "GET",
How to call rest api using type: "Put", dataType: "jsonp",
ajax to get a product details dataType: "JSONP", url:
in JSON format using Jquery url: "http://localhost:8080
if Application name is restws "http://localhost:8080/rest /restws/json/product/
5 and context path is json? ws/json/product/get", get",

How put and post methods post method is


6 are differed in functionality put method is idempotent idempotent

What is the output for this


code ? Request:
GET
https://api.everlive.com/v1/
your-app-id/Books
Headers:
Authorization Bearer
your-access-token
X-Everlive-Sort { "Author" :
1} author in decending
7 author in assending order order
What is the output for this
code ? Request:
GET
https://api.everlive.com/v1/
your-app-id/Books
Headers:
Authorization Bearer
your-access-token
X-Everlive-Sort { "Author" :
8 -1 } auther in assending order auther in decending or
What are the operations
9 support by Paging? Read write

Given a service that lists


sandwiches, what action
would we perform to get all
10 of the pizzas? POST /pizza GET /pizzas

Which of the following


component of HTTP request
indicates HTTP methods such
as GET, POST, DELETE, PUT
11 etc.? VERB URI

target.path("rest").
target.path("rest").path(
path("hello").reque
"hello").request().accept
To receive the XML response st().accept(MediaTy
(MediaType.TEXT_XML).
pe.TEXT_HTML).get
get(String.class);
(String.class);
12

In the REST architectural


style, data and functionality Block Unit
Which of these as
are considered is a
Reference Implementation
13 for building RESTful Web
service?

14 Jersey GlassFish
Which of these artifact id
used in pom to integrate <artifactId>jersey-imp</
jersey? artifactId> <artifactId>jersey-
15 server</artifactId>
SOAP’s standard HTTP
RESTful web services are protocol makes it easier
used because it for it to operate across
firewalls and proxies uses services
without modifications to interfaces to expose
16 the SOAP protocol the business logic.
Which of the following is a
JAX-RS implementation in
java?

17 Jersey RestEasy

Which of these web service


type require HTTP error
handling?
18 SOAP REST

Which defines media type


for the response such as
XML, PLAIN, JSON etc. It
defines the media type that
the methods of a resource
class or MessageBodyWriter
19 can produce. @Consumes @Produces
@Path("/add")
public Response addUser(
@FormParam("id") int
id,
@FormParam("name")
String name,
@FormParam("price")
float price) {

return
Response.status(200)
.entity(" Product
added successfuly!<br> Id:
"+id+"<br> Name: " +
name+"<br> Price: "+price)
.build();
}
}

In the above code snippet


choose the correct param add.id,add.name.add.
20 names in HTML id,name,price price
@Path("/hello")
public class HelloService{
@GET

@Path("{year}/{month}/{day
}")
public Response getDate(
@PathParam("year")
int year,

@PathParam("month") int
month,
@PathParam("day")
int day) {

String date = year + "/" +


month + "/" + day;

return
Response.status(200)
.entity("getDate is
called, year/month/day : " +
date)
.build();
} } what could be the
21 request path rest/hello/2014/12/05 rest/hello/05/12/2014

@GET

@Produces(MediaType.TEXT
_HTML)
public String sayHtmlHello()
{
return "<html> " +
"<title>" + "Hello Jersey" +
"</title>"
+ "<body><h1>" + "Hello
Jersey HTML" +
"</h1></body>" + "</html>
";
}

the
above code snippet will
22 produces response of type HTML XML
________ is a popular
micro-blogging site uses
REST Webservices
extensively.
23 Orkut Twitter

@Path("/restwb")
public class WelcomeRest {
@GET
@Path("/msg/{name}")
@Produces("text/plain")
public String
getWelcomeMsg(@PathPara
m("name") String name){
return "Welcome "+name;
}
} for the above webservice
choose the correct option for
24 client request URL http://localhost:8080/RestWB/restwb/smith
http://localhost:8080/RestWB/"smith"

Client config = new


ClientConfig config = new ClientConfig();
DefaultClientConfig(); Client client =
Client client = Client.create(config);
Client.create(config); WebResource
WebResource service service =
Choose the correct option to = client.resource(REST_
create WebService object in client.resource(REST_URI); URI);
25 REST client application
ClientResponse resp = ClientResponse resp =
webResource.accept("appli webResource.accept("
cation/json").get(ClientRes application/json").get(
ponse.class); ClientResponse.class);
How to get the response MultivaluedMap<String,Str MultivaluedMap<Strin
headers using Jersey ing> valueMap = g,String> valueMap =
26 ClientResponse object? resp.getHeaderList(); resp.getHeaders();
Publishing an application’s @RequestMapping @PathVariable
data as a REST service
method need to be provided
with metadata.Choose the
correct option

27

@GET

Produces(MediaType.TEXT_P
LAIN)
public String
sayPlainTextHello() {
return "Hello Jersey";
} the above method is
28 called if TEXT_PLAIN is request XML is a request

Which of these is a way the


addition of microservices It will create more coupling
may affect a large between application data It will enable more
organization? from code and the cross team
29 underlaying infrastructure collabaration

Netflix Service Discovery


Server and Client. Netflix
30 Netflix Projects list Ribbon and Load Balancer SpringBoot project
LE
ANS IMG_ VE
c d e f WER PATH L TOPIC SUB_TOPIC

REST RESTful
TCP/IP FTP b 1 Webservices webservices

REST REST with HTTP


400 401 b 2 Webservices statuscodes
no certain URL is depends upon the REST RESTful
specified platform used a 2 Webservices webservices

PUT maps to get maps to Create,


update, GET maps post maps to
to post POST maps Retrieve, put maps
to create DELETE to Update, DELETE REST REST with CRUD
maps to Delete. maps to Delete. b 3 Webservices applications

$.ajax({
type: "POST", $.ajax({
dataType: type: "GET",
"jsonp", dataType: "jsonp",
url: url:
"http://localhost:8 "http://localhost:80
080/restws/json/pr 80/restws/json/prod REST
oduct/get", uct/post", b 3 Webservices REST with JSON

post method is not put method is not REST


idempotent idempotent a 2 Webservices REST methods

REST
id in assending orde id in decending order a 3 Webservices REST webservices
REST REST CRUD
id in assending orde id in decending order b 3 Webservices operations
REST REST CRUD
Delete GET a,c 2 Webservices operations

REST REST CRUD


GET /pizza DELETE /pizzas b 2 Webservices operations

REST
HTTP Version Request Header a 1 Webservices REST methods

target.path("rest
").path("hello").r
equest().accept( target.path("rest").p
MediaType.TEXT ath("hello").request(
_TEXT).get(String ).accept(MediaType.
.class); TEXT_JSON).get(Stri REST REST Content
ng.class); a 3 Webservices negotiation

Code Resource
REST
d 2 Webservices REST architecture

REST
Apache Camel Web api logicser a 3 Webservices REST architecture

<artifactId>jersey- REST REST Content


service</artifactId> None of the options b 3 Webservices negotiation
Easy,straight
forward,
supports multiple requires more
data formats like bandwidth and REST REST Content
XML, JSON e.t.c. resource c 2 Webservices negotiation

REST
Struts 1.0 Jersy and RestEasy d 1 Webservices REST Webservice

REST
Both SOAP and RESTRMI b 1 Webservices REST Webservice

REST
@GET @POST b 3 Webservices REST annotations
REST
Id,Name,Price $id,$name,$price a 3 Webservices
REST
hello/02/03/2015 /hello a 3 Webservices

REST
JSON txt a Webservices
REST
Facebook FriendFeed b 2 Webservices REST webservices

http://localhost:8080/RestWB/restwb/{smith}
http://localhost:8080/RestWB/smith

REST REST webservices


a 3 Webservices annotations

ClientConfig config =
Config config = new
new Config(); DefaultClientConfig()
Client client = ;
Client.create(config Client client =
); Client.create(config);
WebResource WebResource
service = service =
client.resource(RES client.resource(REST
T_URI); _URI); REST REST webservice
b 3 Webservices client
ClientResponse
resp = ClientResponse resp
webResource.acce =
pt("application/jso Resource.accept("ap
n").get(ClientRespo plication/json").get(
nse.class); ClientResponse.class
MultivaluedMap<S );
tring,String> MultivaluedMap<Str
valueMap = ing,String>
resp.getHTTPHead valueMap = REST REST webservice
er(); resp.getHeader(); b 2 Webservices client
a,b WSDL

REST REST services


c 2 Webservices hands on

REST
JSON is a request HTML is a request a 3 Webservices REST webservices

It will increase the


need for single It wll need cluster REST Microservices
server setups environment a 2 Webservices architecture

SpringBoot with REST Microservices


JPA SpringBootORM a 2 Webservices architecture
REMARK QUE_ID
Compatibility Report for RestfulQB_Mphasis-Aruna - Copy.xls
Run on 5/11/2018 18:03

The following features in this workbook are not supported by earlier versions
of Excel. These features may be lost or degraded when opening this workbook
in an earlier version of Excel or if you save this workbook in an earlier file
format.

Minor loss of fidelity # of occurrences

Some cells or styles in this workbook contain formatting that is not supported 9
by the selected file format. These formats will be converted to the closest
format available.
Version

Excel 97-2003

You might also like