Monday Mar 30, 2009
Monday Mar 30, 2009
Over the years, the Enterprise Java Technologies Tech Tips have covered a wide variety of enterprise Java technology topics. Here's a short quiz that tests your knowledge of some topics covered in recent Tech Tips. You can find the answers at the end of the quiz.
Client object for the RESTful web service client. What do you need to create next so that the
Client object can be used to issue web service requests?
a. A ClientPipe object.
b. A WebResource object.
c. A ServiceRequest object.
d. A ClientFactory object.
e. None of the above.
What does the getPreferredPrefix() method in the PreferredMapper class do?
a. Returns the preferred prefix, mappedNamespace to be declared at the root element of the marshalled XML.
b. Returns the preferred namespace prefix, jc, and namespace URI, mappedNamespacee, to be declared at the root
element of the marshalled XML.
c. Returns the preferred prefix, mappedNamespacea, to be declared at the root element of the marshalled XML.
d. Returns a list of preferred namespace prefixes, jc, e, and m, to be declared
in elements of the marshalled XML.
e. None of the above.
javafx.servlet.sip.SipFactory interface provides utility methods to create a Session Initiation
Protocol (SIP) request in an enterprise application. Which of the following statements about the SipFactory
interface is true?
a. A SipFactory instance can be injected into a Java EE component such as an EJB or MJB using the
@SIP annotation.
b. A SipFactory instance cannot be used in a Converged Enterprise Application.
c. SipFactory instances that belong to multiple SIP applications can be injected into a Java EE component,
whether the applications are co-located in the same .ear file or not.
d. A SipFactory is specific to a SIP application and there can be only one SipFactory instance
for each SIP application.
a. Supports token refactoring.
b. Supports token issuance and token validation protocols.
c. Supports the Security Token Service (STS) framework
d. Supports issuing SAML 1.0, SAML 1.1 and SAML 2.0 tokens, by default.
e. Supports the issuing of symmetric proof keys, public proof keys, and no proof keys.
a. Cipher references
b. STS tokens
c. Boundary parts
d. User profiles
e. Signature values
Answers
Client object for the RESTful web service client. What do you need to create next so that the
Client object can be used to issue web service requests?
a. A ClientPipe object.
b. A WebResource object.
c. A ServiceRequest object.
d. A ClientFactory object.
e. None of the above.
b. A WebResource object. After you create a Client instance, you can start using it. However, to
issue requests, you need to create a WebResource object, which encapsulates a web resource for the client.
You use the WebResource object to build requests to send to the web resource and to process responses returned from
the web resource. For example, you can use the WebResource object for HTTP GET, PUT,
POST, and DELETE requests. For more information about using the Jersey 1.0.2 Client API,
see the February 26, 2009 Tech Tip,
Consuming RESTful Web Services With
the Jersey Client API.
What does the getPreferredPrefix() method in the PreferredMapper class do?
a. Returns the preferred prefix, mappedNamespace to be declared at the root element of the marshalled XML.
b. Returns the preferred namespace prefix, jc, and namespace URI, mappedNamespacee, to be declared at the root
element of the marshalled XML.
c. Returns the preferred prefix, mappedNamespacea, to be declared at the root element of the marshalled XML.
d. Returns a list of preferred namespace prefixes, jc, e, and m, to be declared
in elements of the marshalled XML.
e. None of the above.
c. Returns the preferred prefix, mappedNamespacea, to be declared at the root element of the marshalled XML.
JAXB 2.0 (or later) provides a service provider interface (SPI) named com.sun.xml.bind.marshaller.NamespacePrefixMapper
that you can use to specify helpful namespace prefixes for marshalling. You implement the SPI and pass it to the
Marshaller. One of the methods in the NamespacePrefixMapper class is getPreferredPrefix(),
which returns a list of namespace URIs that should be declared at the root element. In the code snippet,
the getPreferredPrefix() method in the PreferredMapper class returns the preferred prefix,
in this case, mappedNamespacea to be declared at the root element of the marshalled XML, as follows:
javafx.servlet.sip.SipFactory interface provides utility methods to create a Session Initiation
Protocol (SIP) request in an enterprise application. Which of the following statements about the SipFactory
interface is true?
a. A SipFactory instance can be injected into a Java EE component such as an EJB or MJB using the
@SIP annotation.
b. A SipFactory instance cannot be used in a Converged Enterprise Application.
c. SipFactory instances that belong to multiple SIP applications can be injected into a Java EE component,
whether the applications are co-located in the same .ear file or not.
d. A SipFactory is specific to a SIP application and there can be only one SipFactory instance
for each SIP application.
d. A SipFactory is specific to a SIP application and there can be only one SipFactory instance
for each SIP application. The SipFactory instance is available in the servlet context of a SIP Application
as an attribute of javax.servlet.sip.SipFactory. The servlet specification defines specific context attributes
that are used to store and retrieve information specific to SIP servlets and interfaces from the context. In the case of
Java EE components such as EJBs and MDBs, which are outside the scope of the servlet context, the SipFactory
is available as a resource. You can inject the resource into a Java EE component such as an EJB or MJB using the
@Resource annotation. For more information about the SipFactory interface, SIP requests, and their
use in converged enterprise applications, see the March 13, 2009 Tech Tip,
Converged Enterprise
Applications.
a. Supports token refactoring.
b. Supports token issuance and token validation protocols.
c. Supports the Security Token Service (STS) framework
d. Supports issuing SAML 1.0, SAML 1.1 and SAML 2.0 tokens, by default.
e. Supports the issuing of symmetric proof keys, public proof keys, and no proof keys.
a. Supports token refactoring. Metro is a high performance, extensible, easy-to-use web services stack. It combines the JAX-WS reference implementation with Project Tango. Project Tango, also called Web Services Interoperability Technology or WSIT, implements numerous WS-* standards to enable interoperability with other implementations and to provide Quality of Service (QOS) features such as security, reliability, and transaction support. WS-Trust is a WS-* specification that provides extensions to the WS-Security specification. Metro supports the WS-Trust specification. In supporting WS-Trust, Metro:
However, it does not support token refactoring. For more information about WS-Trust support in Metro, see the October 14, 2008 Tech Tip Using WS-Trust Support in Metro to Secure Web Services.
a. Cipher references
b. STS tokens
c. Boundary parts
d. User profiles
e. Signature values
c. Boundary parts. When SOAP attachments are used in a SOAP message, the SOAP message is accompanied by a MIME header and possibly multiple boundary parts. This is known as a SOAP message package. The primary SOAP envelope is generally conveyed in the first MIME part. The attachments are carried in other MIME parts and are referenced from the SOAP envelope. Learn more about SOAP message attachments and how they can be secured with Metro in the September 29, 2008 Tech Tip Securing Attachments With Metro 1.3.
2009 JavaOne Conference, June 2-5, San Francisco ** Register Now**
Stay on top of everything new and different, both inside and around Java technology. Register by April 22, 2009, and save $200 off a Conference Pass or Conference Plus Pass. Register now at http://java.sun.com/javaone.