Spring Questions and Answers – Web Services Using spring-questions-answers-WS

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

Answer: a
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

Answer: a
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

Answer: a
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
DOM AbstractDomPayloadEndpoint
advertisement
advertisement

4. Endpoint Classes for JDOM:-
a) AbstractDomPayloadEndpoint
b) AbstractJDomPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractXomPayloadEndpoint
View Answer

Answer: b
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

Answer: c
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
dom4j AbstractDom4jPayloadEndpoint
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Endpoint Classes for XOM:-
a) AbstractDomPayloadEndpoint
b) AbstractJDomPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractXomPayloadEndpoint
View Answer

Answer: d
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

Answer: b
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
SAX AbstractSaxPayloadEndpoint
advertisement

8. Endpoint Classes for Event-based StAX:-
a) AbstractDomPayloadEndpoint
b) AbstractSaxPayloadEndpoint
c) AbstractDom4jPayloadEndpoint
d) AbstractStaxEventPayloadEndpoint
View Answer

Answer: d
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

Answer: c
Explanation: Endpoint Classes for Different XML Processing Technologies/APIs
Technology/API Endpoint Class
Streaming Stax AbstractStaxStreamPayloadEndpoint
advertisement

10. Endpoint Classes for XML marshalling :-
a) AbstractDomPayloadEndpoint
b) AbstractSaxPayloadEndpoint
c) AbstractStaxStreamPayloadEndpoint
d) AbstractMarshallingPayloadEndpoint
View Answer

Answer: d
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

Answer: a
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

Answer: a
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

Answer: c
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

Answer: a
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

Answer: c
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.