1. @WebService(name="LogInventory")
2. public class InventoryReader {
3. @WebMethod(operationName=check?
4. @OneWay
5. public void checkProduct(String name);
6. @WebMethod
7. public void addInventory(
8. @WebParam(name="total") int quantity)
9. throws InventoryException;
10. }
Assume the code is free of gross flaws and syntax errors.Which two statements are true?
(Choose two.)
A. Line 8 specifies that addInventory accepts either a valid total or quantity.
B. Line 1 indicates the portType is LoginInventory.
C. Line 3 shows the method is mapped to the WSDL operation called checkProduct?
D. Line 4 means that a method is not expected to return a value unless requested.
E. Line 6 implies WSDL operation and method name are the same.
Answer: B,E
QUESTION NO: 110
Which statement is true about the tool integration in JAX-WS?
A. WSIT is Sun's open source implementation of tools using the provider API.
B. Java offers a tool provider API, though the tools themselves come from third parties.
C. The API allows tool use from the command line, Ant and IDE.
D. C and C++ are most commonly used to extend the annotation library.
Answer: C
QUESTION NO: 111
What happens when you start development of a service from a WSDL file?
A. The service endpoint can be implemented after wsimport creates the portable artifacts.
B. The wsgen tool and Java source generate a client, based on the WSDL.
C. The apt can be used to generate portable artifacts, based on an annotated WSDL.
D. Providing wsgen, a WSDL deployed in a WAR will create classes specifically for the interface.
Answer: A
QUESTION NO: 112
Which two statements are true about the apt? (Choose two.)
A. The apt compiles classes and processes annotations added with JSR 175.
B. Ant tasks are NOT suitable to launch the apt.
C. The apt is an example of an external tool and not part of JAX-WS core libraries.
D. The apt is an annotation marshalling tool and works with a supplied annotation map.
E. The tool uses the command format: java apt <source files>.
Answer: A,C Explanation:
QUESTION NO: 113
Which two statements are true about creating a Web service with JAX-WS? (Choose
two.)
A. Stateless Web services must be created with HTTP servlet endpoints.
B. Creating the portable artifacts by hand is slow, but makes a service easier to maintain.
C. All Java-based endpoints share a common packaging model.
D. EJBs can serve as endpoints if hosted in a container with runtime and service support.
E. JAX-WS supports creating services from source and compiled code without a WSDL.
Answer: D,E
QUESTION NO: 114
What are three functions of annotations? (Choose three.)
A. Annotations play a role in compile-time and runtime processing.
B. Annotations aid deployment of Services, based on classes, but complicate the start from WSDL approach.
C. A virtue of annotations is the reduction of hands-on deployment descriptors.
D. Custom annotations expose useful deployment information to cross platform services.
E. Increased value from reflection is a benefit of annotations.
Answer: A,C,E
QUESTION NO: 115
What happens when a Web service is created with JAX-WS?
A. The annotation @WebParams denotes an operation with parameters.
B. The service endpoint interface is most easily created implicitly with annotations.
C. Services must provide a non-WSDL interface if clients use dynamic invocation.
D. The slight reduction in productivity from using annotations is more than offset by improved runtime performance.
Answer: B
QUESTION NO: 116
A developer new to Web services is researching how a client can connect to a service. It
is clear that some models provide better abstraction while others offer more power when
working with messages.What is the correct reason to choose the Dispatch interface?
A. Dispatch is a high-level API that helps hide the complexity of XML.
B. REST services can be consumed with the Dispatch API and XML/HTTP bindings.
C. The Dispatch interface supports the use JAXP to bind data.
D. The Dispatch interface is represented internally as a SOAP message.
Answer: B
QUESTION NO: 117
A developer must modify an existing Web service client program. XML used by the
service must be updated and archived for use in other systems. The developer chooses the
Dispatch API. Which two statements are true about this approach? (Choose two.)
A. Dispatch is generic and can be instantiated for use with XML or SOAP.
B. The Web service can be either SOAP or REST-based.
C. The Dispatch instance must be created in Service.Mode.PAYLOAD mode in order to use SOAP.
D. Instantiating Dispatch Service.Mode.MESSAGE mode allows you to work directly with the XML message.
E. It is unnecessary to use JAXB with the Dispatch API.
Answer: A,B
QUESTION NO: 118
A developer needs to create a portable client for an existing SOAP-based Web service
using JAX-WS. The requirements state that the client proxy must be able to catch
service-specific exceptions. The developer requests access to the service endpoint
implementation.Which statement is true?
A. The existing service endpoint implementation is required.
B. JAX-WS proxies are dynamic so the service endpoint must be redesigned.
C. The developer should have requested the WSDL rather than the service endpoint implementation.
D. Catching service-specific exceptions makes the system backwards compatible with JAX-RPC.
Answer: C
QUESTION NO: 119
A developer is given a WSDL for an existing Web service.What is the correct sequence
of steps that must be taken to use that Web service?
A. parse the WSDL using JAXP, connect to the service using RMI, and then parse the XML using SAX
B. use a utility (such as wsimport) to read the WSDL and generate a service endpoint interface
C. register the WSDL with wsgen, bind to the stubs, and then call methods on the interface
D. receive the service using RMI, parse the XML using JAXP, create Java objects using JAXR, and then return those Java objects
Answer: B
QUESTION NO: 120
Which statement is true about clients for Java EE 5 Web services and JAX-WS?
A. Java SE 6 clients are only possible when additional libraries are available at compile time.
B. Java EE 5 clients must have common runtime and communication characteristics.
C. All Java EE 5 components, including Java ME, are viable Web service clients.
D. Non-Java services must explicitly support the JAX-WS client communication models to be interoperable.
Answer: C
QUESTION NO: 121
A team of developers is designing RESTful Web services for a new application.What are
three properties of the services? (Choose three.)
A. They can be stateful.
B. They can be stateless.
C. Components communicate by exchanging representations of the resource.
D. Components communicate by directly performing operations on the resource.
E. They require WSDL service API definitions.
F. Responses can be labeled as cacheable or non-cacheable.
Answer: B,C,F
QUESTION NO: 122
An engineer is creating a RESTful Web service client and is working with JAXB
data bound java.lang.Object requests.Which four message exchange protocols are
supported when using the javax.xml.ws.Dispatch<T> interface? (Choose four.)
A. request-response B. response-request C. one-way
D. mailbox model E. asynchonous polling F. chronological sequencing G. callback
Answer: A,C,E,G
QUESTION NO: 123
RESTful Web services have an interface of well-known standard operations, and
all services are accessed through this interface.What are the four standard operations
available for RESTful Web services? (Choose four.)
A. GET
B. CONNECT C. PUT
D. SUBMIT E. POST F. HEAD G. DELETE Answer: A,C,E,G
QUESTION NO: 124
What are three characteristics of JSON Web service messages? (Choose three.)
A. provide interface contracts that are easy to enforce B. are self-describing
C. utilize a collection of name/value pairs D. utilize ordered lists of values
E. provide built-in message security
F. allow minimum to no coding of object de-serialization Answer: C,D,F
QUESTION NO: 125
Which two implementations of JSON Web services benefit from the inherent
structure of JSON messages? (Choose two.)
A. remote procedure calls B. geocoding
C. Enterprise Service Bus messaging D. map image
E. stateful session management Answer: B,D
QUESTION NO: 126
Which two features of JSON formatted messages in Web services are responsible for its
increasing popularity? (Choose two.)
A. widely available implementations B. built-in browser parsing support C. well supported by Ajax toolkits D. simple API
E. tag-based message format Answer: C,D
QUESTION NO: 127
A team of engineers is using JAX-WS to implement both RESTful and SOAP Web
services. Which two exception classes will they use? (Choose two.)
A. javax.xml.ws.soap.SOAPException B. javax.xml.ws.soap.SOAPFaultException C. javax.xml.ws.soap.FaultException D. javax.xml.ws.http.HTTPException E. javax.xml.ws.http.HTTPFaultException F. javax.xml.ws.http.FaultException Answer: B,D
QUESTION NO: 128
A developer is tasked with analyzing a new Web services project and must decide to use
either SOAP or REST. Based on requirements, the developer determines the service
must be stateful and have a documented interface and data types that clients can
discover dynamically.Which two statements are true? (Choose two.)
A. The SOAP approach consists of resources identified by unique URIs.
B. SOAP services are self-documenting via the WSDL.
C. Either SOAP or REST are suitable for the Web service.
D. REST fully documents data types via the functional interface GET and POST.
E. RESTful services are stateless by definition.
Answer: B,E
QUESTION NO: 129
A developer needs to implement stateful Web services for their new application by
maintaining a session with the client application.Which two technologies should the
developer use to implement Web services? (Choose two.)
A. EJB Endpoint B. Servlet Endpoint C. JSON
D. REST E. SOAP F. JAXP Answer: B,E
QUESTION NO: 130
What are two benefits of utilizing JSON-based Web services when compared to a
solution that is XML-based? (Choose two.)
A. good namespace support B. fast object de-serialization
C. plentiful selection of development tools D. grammar defined by DTD
E. concise format
F. can be used for a wide variety of tasks
Answer: B,E Explanation:
QUESTION NO: 131
A company is implementing an accounting system, where every transaction is monitored
and audited. They must implement message-oriented Web services in their
accounting package to integrate various modules. All errors in computation or
transmission must be logged.Which two technologies will they use? (Choose two.)
A. SOAP B. REST C. JAXR D. XML E. JSON F. JSP Answer: A,D
QUESTION NO: 132
A company is receiving a large XML document from a vendor and they need to extract
the content of the document and update their invoicing tables with the data.What are two
reasons to utilize the SAX parser as a solution? (Choose two.)
A. It is an event-based API that is used when parsing XML documents.
B. It allows non-sequential access to the document.
C. It is an XML messaging API that is used to send and receive SOAP documents.
D. It is a set of interfaces and classes that models the structure of a SOAP document.
E. It models the structure of a parsed XML document as a tree of objects called nodes.
F. It will improve resource utilization.
Answer: A,F
QUESTION NO: 133
A company has been evaluating the capabilities of JAXP. In addition to SAX and DOM,
which two are supported by JAXP in Java EE 5? (Choose two.)
A. XSLT B. JAXB C. JSSE D. JDBC E. Xpath F. JAXR Answer: A,E
QUESTION NO: 134
A company is creating a new XML document for their payroll program. When a new
person is hired, a new Employee Element must be added, and child elements and text
must be added to the child elements. Which lines satisfy this requirement?
A. Element newEmp = document.createElement( "employee" );
Element newname = document.createElement( "name" );
Node nameNode = document.createNode( "John Smith");
newname.appendChild( nameNode ); newEmp.appendChild( newname );
B. Element newEmp = document.createElement( "employee" );
Element newname = document.createElement( "name" );
String nameString = document.createStringNode( " John Smith");
newname.appendChild( nameString );
newEmp.appendChild( newname );
C. Element newEmp = document.createElement( "employee" );
Element newname = document.createElement( "name" );
Text nameText = document.createTextNode( " John Smith");
newname.appendChild( nameText );
newEmp.appendChild( newname );
D. Node newEmp = document.createNode( "employee" );
Node newname = document.createNode( "name" );
String nameString = document.createStringNode( " John Smith");
newname.appendString( nameString ); newEmp.appendNode( newname );
Answer: C
QUESTION NO: 135
A developer has to process many similar, but structurally different XML documents and
has decided to use the JAXB binding compiler.Which three factors support this decision?
(Choose three.)
A. It is used only at compile time and accepts an XML schema as an input.
B. It is used at run time and accepts an XML schema as an input.
C. It builds an in-memory content tree.
D. With JAXB, only event handlers need to be written to map XML content to Java classes.
E. It generates Java interfaces using standard XML data type mapping and runtime-specific implementations.
F. It generates Java interfaces using standard XML data type mapping, and developers must provide their implementations.
Answer: A,C,E
QUESTION NO: 136
Place the general steps in the JAXB data binding process in the correct order.
a . compile classes
b . generate classes
c . generate content tree
d . marshall
e . process content
f . unmarshall
g . validate
A. f,b,a,c,g,e,d B. b,a,d,c,g,e,f C. b,a,f,c,g,e,d D. b,a,d,c,e,f,g E. f,c,a,b,g,e,d Answer: C
QUESTION NO: 137
An engineer is studying the architecture of the JAXB implementation.What are three
components in its design? (Choose three.)
A. schema compiler B. built-in SAX parser C. schema generator
D. built-in DOM parser
E. binding runtime framework F. schema interpretor
Answer: A,C,E
QUESTION NO: 138
What are two characteristics of the SAAJ API implementation? (Choose two.)
A. It is used to parse XML schemas.
B. It is used for unmarshalling WSDL documents to Java classes.
C. It can represent XML namespaces, elements, attributes, and text nodes.
D. It offers a full feature set for arbitrary work with XML.
E. SAAJ extends the SAX API.
F. SAAJ extends the DOM API.
Answer: C,F
QUESTION NO: 139
A developer is using SAAJ to create a new SOAP message and access the header and
body.Which lines of code will accomplish this?
A. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.newMessage();
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getSOAPEnvelope();
7. SOAPHeader header = envelope.getSOAPHeader();
8. SOAPBody body=envelope.getSOAPBody();
B. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.new(Message());
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getEnvelope();
7. SOAPHeader header = envelope.getHeader();
8. SOAPBody body=envelope.getBody();
C. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.createMessage();
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getEnvelope();
7. SOAPHeader header = envelope.getHeader();
8. SOAPBody body=envelope.getBody();
D. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.createMessage();
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getSOAPEnvelope();
7. SOAPHeader header = envelope.getSOAPHeader();
8. SOAPBody body=envelope.getSOAPBody();
E. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.createMessage();
4. //Accessing elements of the message 5. SOAPPart soapPart = request.getPart();
6. SOAPEnvelope envelope = soapPart.getEnvelope();
7. SOAPHeader header = envelope.getHeader();
8. SOAPBody body=envelope.getBody();
Answer: C
QUESTION NO: 140
Which two code fragments are valid for adding an attachment in SAAJ? (Choose two.)
A. SOAPMessage object.AttachmentPart attachment=request.createAttachementPart();
String stringContent = Update total? attachment.setContent(stringContent,text/plain?;
attachment.setContentID(update_total?; request.addAttachmentPart(attachment);
B. SOAPMessage object.Attachment attachment=request.createAttachement(); String stringContent = Update total? attachment.setContent(stringContent,text/plain?;
attachment.setContentID(update_total?; request.addAttachment(attachment);
C. URL url = new URL(http://eshop.com/products/tb.jpg?; DataHandler datahandler = new DataHandler(url); AttachmentPart attachment =
request.createAttachmentPart(dataHandler); attachment.setContentID (attached_image?;
request.addAttachmentPart(attachment);
D. URL url = new URL(http://eshop.com/products/tb.jpg?;DataHandler datahandler = new DataHandler(url); Attachment attachment = request.createAttachment(dataHandler);
attachment.setContentID (attached_image?; request.addAttachment(attachment);
E. SOAPMessage object.Attachment attachment=request.newAttachement(); String stringContent = Update total? attachment.setContent(stringContent,text/plain?;
attachment.setContentID(update_total?; request.setAttachment(attachment);
Answer: A,C
QUESTION NO: 141
A developer intends to use JAXR to update information in a UDDI registry.Which two
statements are true about JAXR? (Choose two.)
A. It requires the use of the JAX-RPC APIs.
B. It only allows clients to perform inquiries.
C. It provides a layer of abstraction over the particular registry provider.
D. If used carelessly, the API can allow clients to delete entries in the UDDI registry that were not created by them.
E. It works with basic level 0 and advanced level 1 features.
Answer: C,E
QUESTION NO: 142
Which two statements are true about JAXR 1.0? (Choose two.)
A. Every JAXR RegistryObject has a unique key.
B. It provides a businessEntity data structure for storing publisher assertions.
C. It provides interfaces for managing the life cycle of registry objects.
D. It provides a bindingTemplate interface that is used to determine if a service is deployed behind a firewall.
E. Clients can load custom capability profiles via a JAXR interface to enable advanced features.
Answer: A,C
QUESTION NO: 143
Which two statements are true about JAXR? (Choose two.)
A. It provides an alternative to JNDI for Enterprise JavaBeans components implemented as SEI.
B. It provides the least common denominator for diverse registry specifications and standards.
C. It defines a pluggable provider architecture that supports registry specifications and standards.
D. It supports a union of the best features of dominant registry specifications, rather than a common intersection of features.
E. It provides a single interface that allows Java business logic to be added to a registry at design time.
Answer: C,D
QUESTION NO: 144
Which statement is true about the mapping of a UDDI tModel in the JAXR 1.0
specification?
A. JAXR APIs cannot be used with a UDDI registry using tModels.
B. UDDI tModels are mapped to the JAXR ServiceBinding interface.
C. UDDI tModels are mapped to JAXR ServiceBinding and JAXR Organization.
D. UDDI tModels are mapped to JAXR ClassificationScheme and JAXR Concept.
Answer: D
QUESTION NO: 145
Which two statements are true about the mapping of UDDI categoryBag and
businessEntity elements in JAXR? (Choose two.)
A. The categoryBag and businessEntity are obsolete and NOT supported in JAXR 1.0.
B. The categoryBag is mapped to JAXR ServiceBinding, and businessEntity is mapped to a JAXR Service.
C. The categoryBag is mapped to JAXR Collection of OrganizationTypes, and businessEntity is mapped to a JAXR RegistryObject.
D. The categoryBag is mapped to JAXR Collection of Classifications, and businessEntity is mapped to JAXR Organization.
E. Both can be associated with the UDDI tModel, which can also be represented in the JAXR information model.
Answer: D,E
QUESTION NO: 146
Which two statements are true about JAXR support for XML registries? (Choose two.)
A. The CapabilityProfile tells a client the capability level of a registry.
B. UDDI registries must support ebXML to be compatible with JAXR.
C. The UnsupportedCapabilityException is processed for errors from non-Java providers.
D. The JAXR API declares methods as level 0 or level 1.
E. JAXR registry clients present an XML schema that defines the infomodel for the provider.
Answer: A,D
QUESTION NO: 147
A Java client, running behind a firewall, needs to connect to a UDDI registry that is
deployed outside the firewall. The client is using the Java EE 5 implementation of JAXR.
The client creates a set of properties that specify the proxy host and port information for
the network in which the client is running.What are the remaining steps required by the
JAXR client to connect to the UDDI registry?
A. assign the properties to a connection factory and create the connection
B. specify the URL of the UDDI registry in the properties, assign the properties to a connection factory, and create the connection
C. specify the URL of the UDDI registry in the properties, assign the properties to a connection factory, assign the properties to a service binding, and create the connection D. specify the URL for the UDDI registry and the tModel in the properties, specify the search criteria for services, assign the properties to a service binding, and create the connection
Answer: B
QUESTION NO: 148