RestfulQB s3
RestfulQB s3
$.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",
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
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
return
Response.status(200)
.entity(" Product
added successfuly!<br> Id:
"+id+"<br> Name: " +
name+"<br> Price: "+price)
.build();
}
}
@Path("{year}/{month}/{day
}")
public Response getDate(
@PathParam("year")
int year,
@PathParam("month") int
month,
@PathParam("day")
int 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"
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
REST RESTful
TCP/IP FTP b 1 Webservices webservices
$.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
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
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
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
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
JSON is a request HTML is a request a 3 Webservices REST webservices
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.
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