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

Mikalai Zaikin

IBA JV


Belarus
Minsk

Redistribution of this document is permitted as long as it is not used for profits.

July 2012

Revision History
Revision $Revision: 120 $$Date: 2012-07-21 22:34:48 +0300 (сб, 21 Ліп 2012) $$Author: mzaikin $
$Id: ocewsd6-guide.xml 120 2012-07-21 19:34:48Z 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 Web Services Developer for Java EE6" test (a.k.a. SCDJWS 6). It covers the Beta Test objectives, which may not match the Production Test objectives. 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 WSDL file 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. To be added
1.1. To be added
Professional hosting         'Oracle Certified Expert Web Services Developer 6' Quiz     Free SCDJWS 5.0 Guide


Hosting provided by PerfoHost: KVM VPS provider. See PefoHost's KVM VPS vs OpenVZ/Virtuozzo vs XEN VPS comparative chart.
CRM-exporter: Vehicle Database Script 1999-2011