Deck 28: Web Services in Java
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/27
Play
Full screen (f)
Deck 28: Web Services in Java
1
Using a web service from a client application is known as ________ a web service.
A) accessing.
B) serving.
C) consuming.
D) publishing.
A) accessing.
B) serving.
C) consuming.
D) publishing.
C
2
A Java client application can consume a web service by adding a ________ to the application, which defines the proxy class that allows the client to access the web service.
A) client reference
B) web client reference.
C) web service client.
D) web service reference.
A) client reference
B) web client reference.
C) web service client.
D) web service reference.
D
3
The ________ annotation indicates that a class represents a web service.
A) @WebService.
B) @WebMethod.
C) @WebParam.
D) None of the above.
A) @WebService.
B) @WebMethod.
C) @WebParam.
D) None of the above.
A
4
The ________ annotation indicates the names of a method's parameters that will be exposed to a client calling one of the web service's methods.
A) @WebService.
B) @WebMethod.
C) @WebParam.
D) None of the above.
A) @WebService.
B) @WebMethod.
C) @WebParam.
D) None of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
5
The ________ annotation indicates the URI for accessing the web service.
A) @Location.
B) @URI.
C) @Path.
D) @URL.
A) @Location.
B) @URI.
C) @Path.
D) @URL.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
6
Each request and response is packaged in a ________ (also known as a ________)-an XML "wrapper" containing the information that a web service requires to process the message.
A) SOAP message, SOAP envelope.
B) message, envelope.
C) SOAP message, SOAP package.
D) None of the above.
A) SOAP message, SOAP envelope.
B) message, envelope.
C) SOAP message, SOAP package.
D) None of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
7
Each new web service class created with the JAX-WS APIs is a ________- you do not need to extend a class or implement an interface to create a Web service.
A) Class.
B) Object.
C) POJO.
D) None of the above.
A) Class.
B) Object.
C) POJO.
D) None of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
8
Each method in a RESTful web service is identified by a unique ________.
A) URL.
B) data format.
C) HTTP method (GET, POST, etc.).
D) cache.
A) URL.
B) data format.
C) HTTP method (GET, POST, etc.).
D) cache.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
9
To create a web service in NetBeans, you first create a project of type________.
A) Web Service Application.
B) Web Application.
C) Service Application.
D) Web Service.
A) Web Service Application.
B) Web Application.
C) Service Application.
D) Web Service.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
10
The ________ annotation indicates that a method can be called remotely.
A) @WebService.
B) @WebMethod.
C) @WebParam.
D) None of the above.
A) @WebService.
B) @WebMethod.
C) @WebParam.
D) None of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
11
________ is an XML-based protocol that allows web services and clients to communicate, even if the client and the web service are written in different languages.
A) SOAP.
B) REST.
C) TCP.
D) UDP.
A) SOAP.
B) REST.
C) TCP.
D) UDP.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
12
To convert a POJO to XML, use the ________ method of the javax.xml.bind.JAXB class.
A) serialize.
B) convert.
C) convertToXML.
D) marshal.
A) serialize.
B) convert.
C) convertToXML.
D) marshal.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
13
The protocol that transmits request-and-response messages is known as the web service's ________ or ________.
A) format, protocol.
B) wire format, wire protocol.
C) web format, web protocol.
D) None of the above.
A) format, protocol.
B) wire format, wire protocol.
C) web format, web protocol.
D) None of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
14
Making a web service available to receive client requests is known as ________ a web service.
A) accessing.
B) serving.
C) consuming.
D) publishing.
A) accessing.
B) serving.
C) consuming.
D) publishing.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
15
JSON does not have a built-in way to represent ________.
A) strings.
B) arrays.
C) dates.
D) objects.
A) strings.
B) arrays.
C) dates.
D) objects.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
16
To bind URL parameters to method parameters, use the ________ annotation.
A) @PathParam.
B) @marshal.
C) @Produces.
D) @BindParam.
A) @PathParam.
B) @marshal.
C) @Produces.
D) @BindParam.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
17
A ________ is a software component stored on one computer that can be accessed via method calls by an application (or other software component) on another computer over a network.
A) web method.
B) web service.
C) web object.
D) None of the above.
A) web method.
B) web service.
C) web object.
D) None of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
18
REST returns data in the ________ format.
A) XML.
B) plain text.
C) HTML.
D) all of the above.
A) XML.
B) plain text.
C) HTML.
D) all of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
19
The computer on which a web service resides is referred to as a ________.
A) server.
B) client.
C) web service host.
D) service repository.
A) server.
B) client.
C) web service host.
D) service repository.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
20
JAX-WS uses ________ to describe web services in a platform-independent manner.
A) XML.
B) SOAP.
C) WSDL.
D) HTML.
A) XML.
B) SOAP.
C) WSDL.
D) HTML.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
21
The ________ annotation enables session tracking in a web service.
A) @SessionScoped.
B) @HttpSessionScope.
C) @HttpSession.
D) None of the above.
A) @SessionScoped.
B) @HttpSessionScope.
C) @HttpSession.
D) None of the above.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
22
To retrieve data from a URL, create a URL object and then call its ________ method.
A) getData.
B) openStream.
C) getReader.
D) openReader.
A) getData.
B) openStream.
C) getReader.
D) openReader.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following is true
A) Only desktop applications can consume web services.
B) Only web applications can consume web services.
C) Desktop and web applications can both consume web services.
D) A web service client must be written in the same programming language
A) Only desktop applications can consume web services.
B) Only web applications can consume web services.
C) Desktop and web applications can both consume web services.
D) A web service client must be written in the same programming language
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
24
For an object to be serialized and unserialized, what must be true about the class definitions on the server and client
A) They must have identical definitions, with the same class name and package.
B) The class names and definitions must match, but the packages may differ.
C) The class definitions must match, but the class name and package may differ.
D) The classes must have the same set of public properties, but the classes may have additional methods that differ and class name and package do not matter.
A) They must have identical definitions, with the same class name and package.
B) The class names and definitions must match, but the packages may differ.
C) The class definitions must match, but the class name and package may differ.
D) The classes must have the same set of public properties, but the classes may have additional methods that differ and class name and package do not matter.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
25
The top level of a JSON text cannot be a(n) ________.
A) number.
B) object.
C) string.
D) both a and c.
A) number.
B) object.
C) string.
D) both a and c.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
26
A ________ enables the client to manipulate the request information that will be sent to the server when invoking a web service method.
A) WebServiceProvider.
B) Provider.
C) Binder.
D) BindingProvider.
A) WebServiceProvider.
B) Provider.
C) Binder.
D) BindingProvider.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck
27
The unmarshal method of the JAXB class takes ________.
A) a String indicating the URL or path of the XML document and a Class< T > indicating the class to convert to.
B) an InputStream indicating the URL or path of the XML document and an object of the appropriate class to store the data.
C) a Reader indicating the URL or path of the XML document; JAXB determines the type of the object from the XML data.
D) a Scanner containing the XML document and a Class< T > indicating the class to convert to.
A) a String indicating the URL or path of the XML document and a Class< T > indicating the class to convert to.
B) an InputStream indicating the URL or path of the XML document and an object of the appropriate class to store the data.
C) a Reader indicating the URL or path of the XML document; JAXB determines the type of the object from the XML data.
D) a Scanner containing the XML document and a Class< T > indicating the class to convert to.
Unlock Deck
Unlock for access to all 27 flashcards in this deck.
Unlock Deck
k this deck