This set of Java Spring online test focuses on “Web Services with XML Marshalling and service endpoints”.
1. Spring-WS supports using XML marshalling technology to marshal and unmarshal objects to and from XML documents.
a) True
b) False
View Answer
Explanation: This technology is also known as object/XML mapping (OXM) because you are actually mapping objects to and from XML documents.
2. To implement endpoints with an XML marshalling technology, you have to extend the:-
a) AbstractMarshallingPayload
b) AbstractMarshalling
c) AbstractMarshallingPayloadEndpoint
d) None of the mentioned
View Answer
Explanation: To implement endpoints with an XML marshalling technology, you have to extend the AbstractMarshallingPayloadEndpoint class and configure an XML marshaller for it.
3. Marshaller for JAXB 1.0:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
View Answer
Explanation: JAXB 1.0 org.springframework.oxm.jaxb.Jaxb1Marshaller.
4. Marshaller for JAXB 2.0:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
View Answer
Explanation: JAXB 2.0 org.springframework.oxm.jaxb.Jaxb2Marshaller.
5. Marshaller for Castor:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
View Answer
Explanation: Castor org.springframework.oxm.castor.CastorMarshaller.
6. Marshaller for XMLBeans:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.xmlbeans.XmlBeansMarshaller
View Answer
Explanation: XMLBeans org.springframework.oxm.xmlbeans.XmlBeansMarshaller.
7. Marshaller for JiBX:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.castor.CastorMarshall
d) org.springframework.oxm.jibx.JibxMarshaller
View Answer
Explanation: JiBX org.springframework.oxm.jibx.JibxMarshaller.
8. Marshaller for XStream:-
a) org.springframework.oxm.jaxb.Jaxb1Marshaller
b) org.springframework.oxm.jaxb.Jaxb2Marshaller
c) org.springframework.oxm.xstream.XStreamMarshaller
d) org.springframework.oxm.jibx.JibxMarshaller
View Answer
Explanation: XStream org.springframework.oxm.xstream.XStreamMarshaller.
9. Spring-WS supports various XML marshalling APIs.
a) Castor
b) JAXB 1.0
c) XMLBeans
d) All of the mentioned
View Answer
Explanation: Spring-WS supports various XML marshalling APIs, including JAXB 1.0, JAXB 2.0, Castor, XMLBeans, JiBX, and XStream.
10. For some marshalling APIs, the object model must be generated by them so that they can insert marshalling-specific information.
a) True
b) False
View Answer
Explanation: Because Castor supports marshalling between XML messages and arbitrary Java objects, you can start creating the following classes by yourself.
11. A marshalling endpoint requires:-
a) marshaller
b) unmarshaller
c) all of the mentioned
d) none of the mentioned
View Answer
Explanation: A marshalling endpoint requires both the marshaller and unmarshaller properties to be set. Usually, you can specify a single marshaller for both properties. For Castor, you declare a CastorMarshaller bean as the marshaller.
12. Castor requires a mapping configuration file to know how to map objects to and from XML documents.
a) True
b) False
View Answer
Explanation: You can create this file in the classpath root and specify it in the mappingLocation property (e.g., mapping.xml).
13. Spring-WS supports annotating an arbitrary class as a service endpoint by:-
a) @Endpoint
b) @End
c) @Point
d) None of the mentioned
View Answer
Explanation: Spring-WS supports annotating an arbitrary class as a service endpoint by the @Endpoint annotation, without extending a framework-specific class.
14. When you are using XML marshalling, WebServiceTemplate requires both the marshaller and unmarshaller properties to be set.
a) True
b) False
View Answer
Explanation: You can also set them to WebServiceGatewaySupport if you extend this class to have WebServiceTemplate auto-created.
15. A Spring-WS client can also marshall and unmarshal the request and response objects to and from XML messages.
a) True
b) False
View Answer
Explanation: As an example, we will create a client using Castor as the marshaller so that you can reuse the object models.
Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring for online test, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Get Free Certificate of Merit in Spring
- Participate in Spring Certification Contest
- Become a Top Ranker in Spring
- Take Spring Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Practice Programming MCQs
- Buy Spring Books
- Buy Information Technology Books
- Apply for Spring Internship
- Apply for Programming Internship