Oracle Certified Expert, Java Platform, Enterprise Edition 6 Web Services Developer Quiz

Mikalai Zaikin

IBA JV


Belarus
Minsk

Redistribution of this document is strictly prohibited without written permission of copyright owner.

July 2012

Revision History
Revision $Revision: 122 $$Date: 2012-07-22 00:31:25 +0300 (нд, 22 Ліп 2012) $$Author: mzaikin $
$Id: ocewsd6-quiz.xml 122 2012-07-21 21:31:25Z mzaikin $

Abstract

The purpose of this document is to help in preparation for Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam (CX-310-232).

This document should not be used as the only study material for Oracle Certified Expert, Java Platform, Enterprise Edition 6 Web Services Developer Test. It might cover not all objective topics, and it might be not enough. I tried to make this document as much accurate as possible, but if you find any error, please let me know.


Preface
I. Exam Objectives
1. Create an SOAP web service in a servlet container
1.1. Create a web service starting from a WSDL file using JAX-WS
1.1.1. Use wsimport tool to generate artifacts from WSDL
1.1.2. Use external and embedded <jaxws:package>, <jaxws:enableWrapperStyle>, <jaxws:class> customizations
1.1.3. Use JAXB customizations to configure mapping.
1.1.4. Build the web service implementation using the above artifacts.
1.1.5. Access MessageContext.SERVLET_CONTEXT from the injected WebServiceContext
1.1.6. Configure deployment descriptors (web.xml, webservices.xml) for URL patterns, HTTP security, container authorization, caller authentication, and message protection. JAX-WS runtime may also be configured to perform message layer authentication and protection.
1.1.7. Compile and package the Web Service into a WAR file
1.1.8. Deploy the Web Service into a Java EE servlet container
1.2. Create a Web Service starting from a Java source using JAX-WS
1.2.1. Use @WebService to indicate a service
1.2.2. Use @WebMethod, @WebMethod(exclude) to indicate service methods
1.2.3. Use @SOAPBinding to select doc/lit, doc/bare, rpc/lit style of web service
1.2.4. Use @Oneway where the service doesn't have any response
1.2.5. Use @WebParam, and @WebResult to customize parameter and operation names
1.2.6. Use checked exceptions to indicate service specific faults.
1.2.7. Use wsgen tool to generate artifacts in Java EE5 (optional in Java EE6, as artifacts are generated at run time).
1.2.8. Configure deployment descriptors (web.xml, webservices.xml) for URL patterns, HTTP security, container authorization, caller authentication, and message protection. JAX-WS runtime may also be configured to perform message layer authentication and protection.
1.2.9. Compile and package the Web Service into a WAR file
1.2.10. Deploy the web service into a Java EE servlet container
2. Create a RESTful web service in a servlet container
2.1. Create a web service using JAX-RS, refer to Jersey implementation for examples
2.1.1. Annotate a class with a @Path annotation to respond to URI templates.
2.1.2. Annotate the class's methods to respond to HTTP requests using the corresponding JAX-RS annotations (@GET, @POST, etc.).
2.1.3. Use the JAX-RS @Consumes and @Produces annotations to specify the input and output formats for the RESTful Web Service.
2.1.4. Use @PathParam, @QueryParam, @MatrixParam and @HeaderParam to extract request data.
2.1.5. Use the UriInfo and UriBuilder to create URIs that refer to resources in the service.
2.1.6. Use ResponseBuilder to create response with customized status and additional metadata.
2.1.7. Implement a MessageBodyReader and MessageBodyWriter to add support for custom request and response data types
2.1.8. Implement ExceptionMapper to map a custom Exception to a response.
2.1.9. Use Request to add support for HTTP preconditions.
2.1.10. Implement the functionality of the JAX-RS resource's methods.
2.1.11. Use @Path on a method to define a subresource.
2.1.12. Configure deployment descriptor (web.xml) for base URL pattern, HTTP security (via security-constraints in web.xml)
2.1.13. Compile and package
2.1.14. Deploy the web service in a Java EE servlet container
3. Create a SOAP based web service implemented by an EJB component
3.1. Create a web service starting from a WSDL file using JAX-WS
3.1.1. Use wsimport tool to generate artifacts and use customization files for wsimports if needed
3.1.2. Create an EJB web service implementations using annotations (@Stateless or @Singleton)
3.1.3. Configure deployment descriptors (ejb-jar.xml, webservices.xml) for transactions, etc.
3.1.4. Configure container role based access control via method-permissions in ejb-jar.xml or via access control annotations on EJB.
3.1.5. Configure caller authentication and message protection; either by Servlet Container via web.xml, and/or by JAX-WS message processing runtime.
3.1.6. Compile and package the web service into a EAR/WAR file (Java EE 6 - WAR can also have EJBs).
3.1.7. Deploy the web service into a Java EE container.
3.2. Create a web service starting from a Java source using JAX-WS
3.2.1. Use wsgen tool to generate artifacts in Java EE5 from EJB classes (optional in Java EE 6 - as artifacts are generated at run time).
3.2.2. Configure deployment descriptors (ejb-jar.xml, webservices.xml) for transactions, etc.
3.2.3. Configure container role based access control via method-permissions in ejb-jar.xml or via access control annotations on EJB.
3.2.4. Configure caller authentication and message protection; either by Servlet Container via web.xml, and/or by JAX-WS message processing runtime.
3.2.5. Compile and package the Web Service into a WAR/EAR file.
3.2.6. Deploy the Web Service into a Java EE container.
4. Create a RESTful Web Service implemented by an EJB component
4.1. Create a Web Service using JAX-RS from EJB classes.
4.1.1. Annotate an enterprise bean class with a @Path annotation to respond to URL patterns.
4.1.2. Annotate the class's methods to respond to HTTP requests using the corresponding JAX-RS annotations (@GET, @POST, etc.).
4.1.3. Use the JAX-RS @Produces and @Consumes annotations to specify the input and output resources for the RESTful Web Service.
4.1.4. Implement the functionality of the JAX-WS resource's methods.
4.1.5. Configure container role based access control via method-permissions in ejb-jar.xml or via access control annotations on EJB.
4.1.6. Configure caller authentication (for access control protected methods) and message protection by Servlet Container via web.xml.
4.1.7. Compile and package.
4.1.8. Deploy the web service in a Java EE servlet container.
5. Configure Java EE security for a SOAP web service
5.1. Configure security requirements of service using Java EE-container based security (overlaps with steps in other tasks - repeated here for convenience)
5.1.1. Configure security requirements through deployment descriptors (web.xml, webservices.xml) for a Servlet-based web service endpoint: container authorization, caller authentication, and message protection. JAX-WS runtime may also be configured to perform message layer authentication and protection.
5.1.2. Configure security requirements through deployment descriptors (ejb-jar.xml, webservices.xml) for EJB-based web service endpoint:
5.1.3. Configure security requirements through deployment descriptor (web.xml) for JAX-RS based web service endpoint.
6. Create a web service client for a SOAP based web service
6.1. Create a standalone client.
6.1.1. Use wsimport to generate artifacts.
6.1.2. Create a client application using these artifacts.
6.1.3. Package and deploy accordingly.
6.2. Create a client in a managed component in a EE container.
6.2.1. Use wsimport to generate artifacts.
6.2.2. Using @WebserviceRef in the client application.
6.2.3. Package and deploy accordingly.
7. Create a web service client for a RESTful web service
7.1. Use a browser to access a JAX-RS resource
7.2. Use the java.net.* APIs to access a JAX-RS resource.
7.3. Use java.net.Authenticator to access a secure JAX-RS resource.
7.4. Use Ajax to access a JAX-RS resource.
7.5. Use the Jersey client API to access a JAX-RS resource.
7.6. Use the JAX-WS HTTP binding to access a JAX-RS resource.
8. Create a SOAP based web service using Java SE platform.
8.1. Create a web service starting from a WSDL file using JAX-WS.
8.1.1. Use wsimport tool to generate artifacts and use customization files for wsimports if needed.
8.1.2. Build the web service implementation using the above artifacts.
8.1.3. Use Endpoint API to configure and deploy it in Java SE 6 platform.
8.2. Create a web service starting from a Java source using JAX-WS.
8.2.1. Use wsgen tool to generate artifacts in Java EE5 (optional in Java EE6 - as artifacts are generated at run time)
8.2.2. Use Endpoint API to configure and deploy it in Java SE 6 platform.
9. Create handlers for SOAP web services.
9.1. Configure SOAP and logical handlers on the server side.
9.1.1. Use @HandlerChain annotation.
9.1.2. Use deployment descriptors.
9.2. Configure SOAP and logical handlers on the client side.
9.2.1. Use deployment descriptors.
9.2.2. Use programmatic API.
10. Create low-level SOAP web services.
10.1. Describe the functions and capabilities of the APIs included within JAXP.
10.2. Describe the functions and capabilities of JAXB, including the JAXB process flow, such as XML-to-Java and Java-to-XML, and the binding and validation mechanisms provided by JAXB.
10.3. Use Provider API to create a web service.
10.3.1. Process the entire SOAP message, using the SAAJ APIs.
10.3.2. Process only the SOAP body, using JAXB.
10.4. Use Dispatch API to create a dynamic web service client.
11. Use MTOM and MIME in a SOAP Web Service.
11.1. Use MTOM on the service.
11.1.1. Use @MTOM annotation with a web service.
11.1.2. Use MTOM policy in WSDL.
11.1.3. Use MTOM in the deployment descriptors
11.1.4. Use MTOMFeature with javax.xml.ws.Endpoint API
11.1.5. Use swaRef in WSDL.
11.1.6. Use MIME binding in WSDL.
11.2. Use MTOM on the client.
11.2.1. Use MTOMFeature with getPort() methods.
11.2.2. Use MTOM in the deployment descriptors.
11.2.3. Sending any additional attachments using MessageContext properties.
12. Use WS-Addressing with a SOAP web service
12.1. Use Addressing on the service
12.1.1. Use @Addressing annotation with a web service
12.1.2. Use wsam:Addressing policy in WSDL
12.1.3. Use Addressing in the deployment descriptors
12.1.4. Use AddressingFeature with javax.xml.ws.Endpoint API.
12.1.5. Use @Action and @FaultAction on the service methods.
12.1.6. Use WebServiceContext.getEndpointReference()
12.2. Use Addressing on the client.
12.2.1. Use AddressingFeature with getPort() methods.
12.2.2. Use Addressing in the deployment descriptors
12.2.3. Use BindingProvider.getEndpointReference()
12.2.4. Use getPort(EndpointReference) methods.
13. Configure Message Level security for a SOAP web service
13.1. Select the appropriate Security Profile for your service. The selection would be based on a match of the Protection guarantees offered by the profile and those required by the service.
13.2. Configure Username/Password callbacks required by the Username Token Profile.
13.3. Configure any server side Validators as maybe applicable for the profile. There are defaults in GlassFish for most of them.
13.4. Optimize interaction between client and server by using WS-SecureConversation.
14. Apply best practices to design and implement Web Services.
14.1. Use different encoding schemes - fast infoset.
14.2. Use GZIP for optimiziing message sizes.
14.3. Use catalog mechanism for WSDL access.
14.4. Refer to WS-I sample app for best practices.
II. Appendices
1. XML Web Service Standards
1.1. Given XML documents, schemas, and fragments determine whether their syntax and form are correct (according to W3C schema) and whether they conform to the WS-I Basic Profile 1.1.
1.2. Describe the use of XML schema in Java EE Web services.
2. SOAP 1.2 Web Service Standards
2.1. List and describe the encoding types used in a SOAP message.
2.2. Describe the SOAP Processing and Extensibility Model.
2.3. Describe SOAP Message Construct and create a SOAP message that contains an attachment.
3. Describing and Publishing (WSDL and UDDI)
3.1. Explain the use of WSDL in Web Services, including a description of WSDL's basic elements, binding mechanisms and the basic WSDL operation types as limited by the WS-I Basic Profile 1.1.
3.2. Describe how WSDL enables one to separate the description of the abstract functionality offered by a service from concrete details of a service description such as "how" and "where" that functionality is offered.
3.3. Describe the Component Model of WSDL including Descriptions, Interfaces, Bindings, Services and Endpoints.
3.4. Describe the basic functions provided by the UDDI Publish and Inquiry APIs to interact with a UDDI business registry.
4. JAX-WS
4.1. Explain JAX-WS technology for building web services and client that communicate using XML.
4.2. Given a set of requirements for a Web Service, such as transactional needs, and security requirements, design and develop Web Service applications that use JAX-WS technology.
4.3. Describe the Integrated Stack (I-Stack) which consist of JAX-WS, JAXB, StAX, SAAJ.
4.4. Describe and compare JAX-WS development approaches.
4.5. Describe the features of JAX-WS including the usage of Java Annotations.
4.6. Describe the architecture of JAX-WS including the Tools SPI that define the contract between JAX-WS tools and Java EE.
4.7. Describe creating a Web Service using JAX-WS.
4.8. Describe JAX-WS Client Communications Models.
4.9. Given a set of requirements, design and develop a Web Service client, such as a Java EE client and a stand-alone client, using JAX-WS.
4.10. Given a set of requirements, create and configure a Web Service client that accesses a stateful Web Service.
5. REST, JSON, SOAP and XML Processing APIs (JAXP, JAXB and SAAJ)
5.1. Describe the characteristics of REST Web Services.
5.2. Describe the characteristics of JSON Web Services.
5.3. Compare SOAP Web Services to REST Web Services.
5.4. Compare SOAP Web Services to JSON Web Services.
5.5. Describe the functions and capabilities of the APIs included within JAXP.
5.6. Describe the functions and capabilities of JAXB, including the JAXB process flow, such as XML-to-Java and Java-to-XML, and the binding and validation mechanisms provided by JAXB.
5.7. Create and use a SOAP message with attachments using the SAAJ APIs.
6. JAXR
6.1. Describe the function of JAXR in Web Service architectural model, the two basic levels of business registry functionality supported by JAXR, and the function of the basic JAXR business objects and how they map to the UDDI data structures.
6.2. Create JAXR client to connect to a UDDI business registry, execute queries to locate services that meet specific requirements, and publish or update information about a business service.
7. J2EE Web Services
7.1. Identify the characteristics of and the services and APIs included in the Java EE platform.
7.2. Explain the benefits of using the Java EE platform for creating and deploying Web Service applications.
7.3. Describe the functions and capabilities of the JAXP, DOM, SAX, StAX, JAXR, JAXB, JAX-WS and SAAJ in the Java EE platform.
7.4. Describe the role of the WS-I Basic Profile when designing Java EE Web Services.
8. Security
8.1. Explain basic security mechanisms including: transport level security, such as basic and mutual authentication and SSL, message level security, XML encryption, XML Digital Signature, and federated identity and trust.
8.2. Identify the purpose and benefits of Web services security oriented initiatives and standards such as Username Token Profile, SAML, XACML, XKMS, WS-Security, and the Liberty Project.
8.3. Given a scenario, implement Java EE based web service web-tier and/or EJB-tier basic security mechanisms, such as mutual authentication, SSL, and access control.
8.4. Describe factors that impact the security requirements of a Web Service, such as the relationship between the client and service provider, the type of data being exchanged, the message format, and the transport mechanism.
8.5. Describe WS-Policy that defines a base set of constructs that can be used and extended by other Web Services specifications to describe a broad range of service requirements and capabilities.
9. Developing Web Services
9.1. Describe the steps required to configure, package, and deploy Java EE Web services and service clients, including a description of the packaging formats, such as .ear, .war, .jar, annotations and deployment descriptor settings.
9.2. Given a set of requirements, develop code to process XML files using the SAX, StAX, DOM, XSLT, and JAXB APIs.
9.3. Given an XML schema for a document style Web service create a WSDL file that describes the service and generate a service implementation.
9.4. Given a set of requirements, create code to create an XML-based, document style, Web service using the JAX-WS APIs.
9.5. Implement a SOAP logging mechanism for testing and debugging a Web service application using Java EE Web Service APIs.
9.6. Given a set of requirements, create code to handle system and service exceptions and faults received by a Web Services client.
10. Web Services Interoperability Technologies
10.1. Describe WSIT, the features of each WSIT technology and the standards that WSIT.
10.2. Describe how to create a WSIT client from a Web Service Description Language (WSDL) file.
10.3. Describe how to configure Web Service providers and clients to use message optimization.
10.4. Create a Microsoft Windows Communication Foundation (WCF) client that accesses a Java Web Service.
10.5. Describes the best practices for production and consumption of data for interoperability between WCF Web Services and Java Web Service clients or between Java WebServices and WCF Web Service clients.
11. General Design and Architecture
11.1. Describe the characteristics of a service-oriented architecture and how Web Services fit this model.
11.2. Given a scenario, design a Java EE Web Service using Web Services Design Patterns (Asynchronous Interaction, JMS Bridge, Web Service Cache, Web Serive Broker), and Best Practices.
11.3. Describe how to handle the various types of return values, faults, errors, and exceptions that can occur during a Web service interaction.
11.4. Describe the role that Web Services play when integrating data, application functions, or business processes in a Java EE application.
12. Endpoint Design and Architecture
12.1. Given a scenario, design Web Service applications using information models that are either procedure-style or document-style.
12.2. Describe the function of the service interaction and processing layers in a Web Service.
12.3. Design a Web Service for an asynchronous, document-style process and describe how to refactor a Web Service from a synchronous to an asynchronous model.
12.4. Describe how the characteristics, such as resource utilization, conversational capabilities, and operational modes, of the various types of Web service clients impact the design of a Web service or determine the type of client that might interact with a particular service.
Professional hosting         Free 'Oracle Certified Expert Web Services Developer 6' Guide     Free SCDJWS 5.0 Guide