This set of Java Spring Multiple Choice Questions & Answers focuses on “Web Services Using spring-questions-answers-WS”.
1. The concept of an endpoint in web services is much like that of a controller in web applications.
a) True
b) False
View Answer
Explanation: The difference is that a web controller deals with HTTP requests and HTTP responses, while a service endpoint deals with XML request messages and XML response messages.
2. Spring-WS provides various abstract endpoint classes for you to process the request.
a) org.springframework.ws.server.endpoint
b) org.springframework.ws.server
c) org.springframework.*
d) none of the mentioned
View Answer
Explanation: Spring-WS provides various abstract endpoint classes for you to process the request and response XML messages using different XML processing technologies and APIs. These classes are all located in the org.springframework.ws.server.endpoint package.
3. Endpoint Classes for DOM:-
a) AbstractDomPayloadEndpoint
b) AbstractJDomPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractXomPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
DOM AbstractDomPayloadEndpoint
4. Endpoint Classes for JDOM:-
a) AbstractDomPayloadEndpoint
b) AbstractJDomPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractXomPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
JDOM AbstractJDomPayloadEndpoint
5. Endpoint Classes for dom4j:-
a) AbstractDomPayloadEndpoint
b) AbstractJDomPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractXomPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
dom4j AbstractDom4jPayloadEndpoint
6. Endpoint Classes for XOM:-
a) AbstractDomPayloadEndpoint
b) AbstractJDomPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractXomPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
XOM AbstractXomPayloadEndpoint
7. Endpoint Classes for SAX:-
a) AbstractDomPayloadEndpoint
b) AbstractSaxPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractXomPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
SAX AbstractSaxPayloadEndpoint
8. Endpoint Classes for Event-based StAX:-
a) AbstractDomPayloadEndpoint
b) AbstractSaxPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractStaxEventPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
Event-based Stax AbstractStaxEventPayloadEndpoint
9. Endpoint Classes for Streaming StAX :-
a) AbstractDomPayloadEndpoint
b) AbstractSaxPayloadEndpoint
c) AbstractStaxStreamPayloadEndpoint
d) AbstractStaxEventPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
Streaming Stax AbstractStaxStreamPayloadEndpoint
10. Endpoint Classes for XML marshalling :-
a) AbstractDomPayloadEndpoint
b) AbstractSaxPayloadEndpoint
c) AbstractStaxStreamPayloadEndpoint
d) AbstractMarshallingPayloadEndpoint
View Answer
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
XML marshalling AbstractMarshallingPayloadEndpoint
11. If you need to get access to the entire SOAP message, you should write an endpoint class by implementing:-
a) org.springframework.ws.server.endpoint.MessageEndpoint
b) org.springframework.ws
c) org.springframework.ws.server.endpoint
d) all of the mentioned
View Answer
Explanation: If you need to get access to the entire SOAP message, you should write an endpoint class by implementing the org.springframework.ws.server.endpoint.MessageEndpoint org.springframework.ws.server.endpoint.MessageEndpoint interface.
12. You can create a dom4j endpoint by extending the:-
a) AbstractDom4jPayloadEndpoint
b) AbstractDom4jPayload
c) AbstractDom4jEndpoint
d) None of the mentioned
View Answer
Explanation: You can create a dom4j endpoint by extending the AbstractDom4jPayloadEndpoint class.
13. In this method, you can access the request XML element, whose type is org.dom4j.Element, and the response document, whose type is org.dom4j.Document, as method arguments.
a) invoke
b) invokeInterval
c) invokeInternal
d) none of the mentioned
View Answer
Explanation: The core method defined in this class that you must override is invokeInternal().
14. Web services can be invoked through the core template class:-
a) org.springframework.ws.client.core.WebServiceTemplate
b) JDBC Template
c) All of the mentioned
d) None of the mentioned
View Answer
Explanation: When using Spring-WS on the client side, web services can be invoked through the core template class org.springframework.ws.client.core.WebServiceTemplate.
15. WebServiceTemplate provides a sendSourceAndReceiveToResult() method that accepts arguments:-
a) java.xml.transform.Source
b) java.xml.transform.Result
c) all of the mentioned
d) none of the mentioned
View Answer
Explanation: In the getTemperatures() method, you first build the request message using the dom4j API. WebServiceTemplate provides a sendSourceAndReceiveToResult() method that accepts a java.xml.transform.Source and a java.xml.transform.Result object as arguments.
Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Practice Programming MCQs
- Apply for Spring Internship
- Check Spring Books
- Apply for Programming Internship
- Check Information Technology Books