Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 1
Given:
<schema targetNamespace="http://sun.cert/types"
xmlns:sun="http://sun.cert/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="Person" type="sun:PersonType"/>
<xsd:complexType name="PersonType">
<xsd:sequence>
<xsd:element name="first" type:"xsd:string"/>
<xsd:element name="last" type:"xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</schema>
Assume all XML fragments are well-formed.
Which two instances of Person are correct? (Choose two.)
A. <Person>
<first>Monty</first>
<last>Duke</last>
</Person>
B. <t:Person xmlns:t="http://sun.cert/types">
<first>Monty</first>
<last>Duke</last>
</t:Person>
C. <t:Person xmlns:t="http://sun.cert/types">
<t:first>Monty</t:first>
<t:last>Duke</t:last>
</t:Person>
D. <p:Person xmlns:p="http://sun.cert/types">
<f:first xmlns:f="http://sun.cert/types">Monty</f:first>
<f:last>Duke</f:last>
</p:Person>
Answer: C D
Question: 2
A developer is writing a request-response Web service. An error occurs when the service
executes.
Which is true about the Body element of the SOAP reply message?
A. It must NOT contain any fault elements.
B. It must contain zero or one fault element.
C. It must contain an array of fault elements.
D. It can contain as many fault elements as it needs.
Answer : B
Question: 3
Where is the Kerberos ticket embedded in a SOAP header processed?
A. Web service interaction layer
B. Web service processing layer
C. Web service interaction and processing layers
D. It is an HTML issue and it is NOT related to Web services.
Page 1 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer : A
Question: 4
Which two are commonly used as SOAP headers? (Choose two.)
A. security information
B. transaction information
C. postal address information
D. stock quote request information
Answer: A, B
Question: 5
According to the WS-I Basic Profile 1.0a, a conformant WSDL 1.1 portType definition is allowed
to use two type operations (that is, Message-Exchange Patterns).
Which two are allowed? (Choose two.)
A. one-way
B. notification
C. solicit-response
D. request-response
Answer: A, D
Question: 6
A developer uses the delete_tModel function to delete five tModels. Which two describe the
behavior of the system after the delete_tModel is executed? (Choose two.)
A. The delete_tModel logically deletes the tModels .
B. The tModels cannot be accessed since they are permanently deleted.
C. The deleted tModels still appear in the results returned by find_tModel.
D. The deleted tModels are omitted from any results returned by find_tModel.
Answer: A, D
Question: 7
A stateful Web service is implemented as an EJB based endpoint.
What are two ways to maintain that state? (Choose two.)
A. by using URL re-writing
B. by adding a session cookie to the HTTP headers
C. by adding a conversation id to the SOAP headers
D. by requiring clients to send a client id parameter to all methods
Answer: C, D
Question: 8
In addition to SAX2 and DOM Level 2, which is supported by JAXP 1.2?
A. XSLT
B. JAXB
C. SAAJ
D. JDBC
Page 2 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer : A
Question: 9
Which SAAJ 1.2 type is used to represent SOAP message header blocks?
A. org.omg.dom.Document
B. javax.xml.soap.SOAPPart
C. javax.xml.soap.DetailEntry
D. javax.xml.soap.SOAPHeaderElement
Answer : D
Question: 10
Given:
11. public BulkResponse findCallerAssociations(
12. Collection findQualifiers,
13. Boolean confirmedByCaller,
14. Boolean confirmedByOtherParty,
15. Collection associationTypes);
...
36. BusinessQueryManager queryMngr =
37. registry.getBusinessQueryManager();
38. BulkResponse response =
39. queryMngr.findCallerAssociations(null,
40. Boolean.TRUE,Boolean.FALSE,null);
A developer has established a JAXR connection to a UDDI registry. The developer executes the
findCallerAssocations method that is defined in lines 11-15. The context for the method
invocation is shown in lines 36-40. The invocation on line 39-40 will return a BulkRespone object.
Which is true about the BulkResponse object?
A. It contains a Collection of Association objects that the other party has confirmed with the
caller.
B. It contains a Collection of Organization objects that have confirmed the associations with the
caller.
C. It contains a Collection of Association objects that the other party has NOT yet confirmed with
the caller.
D. It contains a Collection of Key objects representing UUID keys for organizations that have
confirmed the associations with the caller.
Answer : C
Question: 11
A developer in a business-to-business environment is required to build a Web service client that
can be strongly authenticated by a Web service.
What must the developer do to create the client?
A. use role-based security
B. implement form-based security
C. implement basic authentication
D. provide a digital certificate that is signed by a Certificate Authority
Answer : D
Question: 12
Page 3 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Given:
<schema targetNamespace="http://sun.cert/types"
xmlns:ns0="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://sun.cert/xsdTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<complexType name="Foo">
<sequence>
<!-- insert code here -->
</sequence>
</complexType>
</schema>
Assuming that no other namespace declarations exist, which two elements use the long type that
is defined in the http://www.w3.org/2001/XMLSchema namespace? (Choose two.)
A. <element name="length" type="long"/>
B. <element name="length type="xsi:long"/>
C. <element name="length" type="xsd:long"/>
D. <element name="length" type="ns0:long"/>
Answer: A, D
Question: 13
Given:
<schema targetNamespace="http://sun.cert/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas/xmlsoap.org/wsdl">
<!-- insert code here -->
</schema>
Assume all XML fragments are well-formed.
According to the WS-I Basic Profile 1.0a, which type definition can be used to define an array of
longs?
A. <xsd:complexType name="longArray">
<xsd:array>
<xsd:element name="item" type="xsd:long"/>
</xsd:array>
</xsd:complexType>
B. <xsd:complexType name="longArray">
<xsd:sequence>
<element name="item" type="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
C. <xsd:complexType name="longArray">
<xsd:array>
<xsd:element name="item" type="xsd:long" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:array>
</xsd:complexType>
D. <xsd:complexType name="longArray">
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="5"
type="xsd:long"/>
</xsd:sequence>
Page 4 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
</xsd:complexType>
Answer : D
Question: 14
Given:
<xsd:schema targetNamespace="http://sun.cert/types"
xmlns:suncert="http://sun.cert/types">
<xsd:element name="fooElement" type="suncert:Foo"/>
<xsd:complexType name="Foo">
<xsd:sequence>
<xsd:element name="age" type="xsd:long"/>
<xsd:element name="last" type="xsd:string"/>
<xsd:element name="first" type="xsd:string"
nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Which two instances of a fooElement are valid? (Choose two.)
A. <fooElement>
<last>Duke</last>
<first xsi:nil="1"/>
</fooElement>
B. <fooElement>
<age>33</age>
<last>Duke</last>
<first>Monty</first>
</fooElement>
C. <fooElement>
<age>33</age>
<last>Duke</last>
<first xsi:nil="1"/>
</fooElement>
D. <fooElement>
<age>33</age>
<last xsi:nil="1"/>
<first>Monty</first>
</fooElement>
E. <fooElement>
<age>33</age>
<last>Duke</last>
<first xsi:nil="1">Monty</first>
</fooElement>
Answer: B, C
Question: 15
Given:
<types>
<schema targetNamespace="http://sun.cert/types"
xmlns:tns="http://sun.cert/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Person">
<xsd:all>
Page 5 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
<!-- insert code here -->
</xsd:all>
</xsd:complexType>
</schema>
</types>
Which two element definitions, when inserted into the given schema fragment, result in a correct
schema type definition? (Choose two.)
A. <xsd:element name="first" type="xsd:string"/>
B. <xsd:element name="items" type="xsd:long" maxOccurs="5"/>
C. <xsd:element name="last" type="xsd:string" minOccurs="1" maxOccurs="1"/>
D. <xsd:element name="first" type="xsd:string" minOccurs="0" maxOccurs="5"/>
Answer: A, C
Question: 16
Given:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://sun.cert/">
<s:Header>
<ns1:transaction>
<user>root</user>
<transid>9b3e64e326537b4e8c0ff19e953f9673</transid>
</ns1:transaction>
</s:Header>
<s:Body>
<m:StockQuote xmlns:m="http://sun.cert/bar/">
<Quote>
<ns1:symbol>SUNW</ns1:symbol>
<ns1:companyname name="Sun"/>
</Quote>
</s:Body>
</s:Envelope>
Which describes this SOAP message?
A. It is NOT well-formed.
B. It contains a mandatory header block.
C. It is WS-I Basic Profile 1.0a compliant.
D. It does NOT contain the correct namespace declarations.
Answer : A
Question: 17
Given:
<service name="InventoryServices">
<port name="PurchaseOrder" binding="tns:POBinding">
<soap:address location="http://192.168.0.2:8080/inventory"/>
</port>
<port name="Invoice" binding="tns:InvoiceBinding">
<soap:address location="http://192.168.0.2:8080/inventory"/>
</port>
</service>
Which describes this WSDL extract?
Page 6 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A. The extract is WS-I Basic Profile 1.0a compliant because both port element names are
different.
B. The extract is NOT WS-I Basic Profile 1.0a compliant because both port elements point to the
same location.
C. The extract is WS-I Basic Profile 1.0a compliant because both port elements point to different
binding elements.
D. The extract is NOT WS-I Basic Profile 1.0a compliant because it contains two port elements
in the same service.
Answer : B
Question: 18
According to the JAX-RPC 1.1 XML-to-Java mappings, which three elements or attribute
declarations are mapped to a Java primitive wrapper class (for example, java.lang.Short)?
(Choose three.)
A. <xsd:element name="age" type="xsd:short" minOccurs="0"/>
B. <xsd:element name="age" type="xsd:short" nillable="true"/>
C. <xsd:element name="age" type="xsd:short" nillable="false"/>
D. <xsd:attribute name="required" type="xsd:boolean" use="optional"/>
E. <xsd:attribute name="required" type="xsd:boolean" use="required"/>
Answer: A, B, D
Question: 19
Which two describe the role of XML schemas in Web services? (Choose two.)
A. DTDs provide stricter data typing than XML schemas.
B. XML schemas can be used to validate the organization of XML documents.
C. Many XML technologies used by Web services are defined using XML schemas.
D. XML schemas cannot be used to validate the data contained in XML documents.
Answer: B, C
Question: 20
Which two are true about the WSDL 1.1 part element? (Choose two.)
A. Global schema types must be referenced by the type attribute.
B. Global schema elements must be referenced by the type attribute.
C. Global schema types must be referenced by the element attribute.
D. Global schema elements must be referenced by the element attribute.
Answer: A, D
Question: 21
Which EAR file can a J2EE 1.4 compatible application server refuse to accept for deployment?
A. no application.xml
one EJB module with J2EE 1.4 version of ejb-jar.xml
one EJB module with J2EE 1.3 version of ejb-jar.xml
one web module with J2EE 1.3 version of ejb-jar.xml
B. J2EE 1.4 version of application.xml
one EJB module with J2EE 1.3 version of ejb-jar.xml
one EJB module with J2EE 1.4 version of ejb-jar.xml
Page 7 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
one web module with J2EE 1.3 version of web.xml
C. J2EE 1.2 version of application.xml
one EJB module with J2EE 1.4 version of ejb-jar.xml
one EJB module with J2EE 1.3 version of ejb-jar.xml
one web module with J2EE 1.3 version of ejb-jar.xml
D. J2EE 1.3 version of application.xml
one EJB module with J2EE 1.4 version of ejb-jar.xml
one EJB module with J2EE 1.2 version of ejb-jar.xml
one web module with J2EE 1.2 version of ejb-jar.xml
Answer : A
Question: 22
Given
<employees xmlns:n1="urn:mycompany" xmlns="urn:partnercompany">
<name fname="John" lname="Smith"/>
<name fname="Frank" n1:lname="Doe"/>
</employees>
Which two are true? (Choose two.)
A. The attribute with the value Doe is bound to the urn:mycompany namespace.
B. The attribute with the value Frank is bound to the urn:mycompany namespace.
C. The attribute with the value Doe is bound to the urn:partnercompany namespace.
D. The attribute with the value Frank is bound to the urn:partnercompany namespace.
Answer: A, D
Question: 23
Given:
<ns1:employees xmlns:ns1="urn:mycompany">
<ns1:manager>
<ns2:name xmlns:ns2="urn:partnercompany">
<fname>John</fname>
<lname>Smith</lname>
</ns2:name>
</ns1:manager>
</ns1:employees>
Which two are true? (Choose two.)
A. The element fname and lname cannot be bound to any namespace.
B. The element fname and lname are bound to the urn:mycompany namespace.
C. The namespace identified by the prefix ns2 can be bound to the element name and its
descendants.
D. The namespace identified by the prefix ns1 can be bound to the element employees and its
descendants.
Answer: C, D
Question: 24
Given:
<employee xmlns="urn:partnercompany" xmlns:n1="urn:partnercompany">
<name fname="John" lname="Smith"/>
<department xmlns="">
<deptName>Engineering</deptName>
</department>
Page 8 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
<costcenter xmlns="urn:partnercompany">
<costId>287277</costId>
</costcenter>
</employee>
Which is true?
A. The name element is NOT bound to any namespace.
B. The costId element is NOT bound to any namespace.
C. The employee element is NOT bound to any namespace.
D. The department and deptName elements are NOT bound to any namespace.
Answer : D
Question: 25
Which three are true about using namespace declarations in an XML document? (Choose three.)
A.
B.
C.
D.
The root element always must be namespace qualified.
A namespace can be used to prevent element and attribute name collisions.
A namespace declaration that does NOT include a prefix is a default namespace.
A namespace must resolve to a real hostname if the namespace declaration uses an HTTP
URL.
E. A namespace is declared with an xmlns attribute, which can associate a prefix with the
namespace.
Answer: B, C, E
Question: 26
Which two namespace declarations are valid? (Choose two.)
A. xmlns="http://sun.cert/types"
B. xmlns:types=http://sun.cert/types
C. xmlns:ns0="http://sun.cert/test:value"
D. xmlns:xmlns="http://www.w3.org/2001/XML"
E. xmlns:xsi="http://www.w3.org/2001/XMLSchema"
Answer: A, E
Question: 27
Given:
<schema targetNamespace="http://sun.cert/types"
xmlns:sun="http://sun.cert/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified">
<xsd:element name="Address" type="sun:AddressType"/>
<xsd:complexType name="AddressType">
<xsd:sequence>
<xsd:element name="street" type:"xsd:string"/>
<xsd:element name="city" type:"xsd:string"/>
<xsd:element name="state" type:"xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</schema>
Assume all XML fragments are well-formed.
Which instance of Address is correct?
Page 9 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A. <Address>
<street>2204 Duke Ave.</street>
<city>Duketown</city>
<state>OR</state>
</Address>
B. <t:Address xmlns:t="http://sun.cert/types">
<street>2204 Duke Ave.</street>
<city>Duketown</city>
<state>OR</state>
</t:Address>
C. <t:Address xmlns:t="http://sun.cert/types">
<t:street>2204 Duke Ave.</t:street>
<t:city>Duketown</t:city>
<t:state>OR</t:state>
</t:Address>
D. <p:Address xmlns:p="http://sun.cert/types">
<f:street xmlns:f="http://sun.cert/types">
2204 Duke Ave.</f:street>
<f:city>Duketown</f:city> <f:state>OR</f:state><p:Address>
Answer : B
Question: 28
In a service-oriented architecture, what role does WSDL play?
A. It defines the semantic behavior of the Web service.
B. It defines the interface that the Web service provides.
C. It ensures that a client is able to invoke the Web service over the Internet.
D. It provides a location where the Web service can be discovered dynamically.
Answer : B
Question: 29
In a service-oriented architecture, which role does UDDI play?
A. It rigorously defines the interface the Web services provide.
B. It defines the semantic behavior of the participating Web services.
C. It provides a location where services can be dynamically discovered.
D. It ensures that a client is able to invoke Web services over the Internet.
Answer : C
Question: 30
How do Web services fit into a Service Oriented Architecture (SOA)?
A. A Web service must be discovered from a UDDI registry in a SOA.
B. SOA and Web services both use the HTTP protocol at the transport layer.
C. A Web service must publish itself to a UDDI registry to become part of a SOA.
D. SOA is an architectural style and Web services provide an implementation strategy.
Answer : D
Question: 31
What are four roles of a service-level agreement in a service-oriented architecture? (Choose
four.)
Page 10 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A. It can be used to enforce the quality of service.
B. It describes the ServiceBinding object in JAXR.
C. It can be used to outline the technology and architecture.
D. It outlines the strategy for situations in which the service fails.
E. It outlines how the service levels will be tracked and monitored.
F. It outlines the business logic, business rules, and tModel for the service.
Answer: A, C, D, E
Question: 32
In a Web service client, which design pattern is most appropriate to obtain the reference to a Web
service?
A. Facade
B. Command
C. Service Locator
D. Business Delegate
Answer : C
Question: 33
A developer is implementing an account aggregation Web service that provides a unified view of
multiple customer data sources in an enterprise.
Which pattern should be used?
A. Proxy
B. Facade
C. Adapter
D. Flyweight
Answer : B
Question: 34
Which two architectures should be used to expose a Web service interface for a legacy enterprise
system? (Choose two.)
A. write an EJB based or a servlet-based endpoint that uses a J2EE connector to access the
legacy enterprise system
B. write an entity bean that accepts incoming XML messages and uses a J2EE connector to
access the legacy enterprise system
C. write an EJB based or a servlet-based endpoint that uses a socket connection or a
proprietary API to access the legacy enterprise system
D. write a standalone application that accesses the legacy enterprise system, translates its data
to the equivalent XML representation and persists the data in an XML database
Answer: A C
Question: 35
An enterprise uses Web services to manage its supply chain consisting of a number of partners
to process orders. The enterprise internally uses a number of systems, each of which
occasionally makes these Web service calls in different stages of order processing.
Which pattern can consolidate all of these Web service interactions in the enterprise?
A. Command
Page 11 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
B. Composite Entity
C. Intercepting Filter
D. Business Delegate
E. Web Service Broker
Answer : E
Question: 36
A client sends a Web service message over HTTP and retries until it succeeds.
Which strategy guarantees the elimination of duplicate messages on the receiver?
A. The sender uses the WSDL one-way operation mode to send the message.
B. The receiver uses an EJB based endpoint and uses transactions on the Web service method
to receive the message.
C. The receiver associates a unique ID with each incoming message and discards the incoming
message if a message with the same ID has already been received.
D. The sender associates a unique ID with each message and the receiver discards the
incoming message if a message with the same ID has already been received.
Answer : D
Question: 37
A supplier has an EJB based endpoint that accepts various types of purchase order documents.
All of the documents' types are defined by the clients who send the purchase orders.
Which two will increase the XML parsing performance at the supplier? (Choose two.)
A. using one-way calls
B. turning off XML validation
C. caching entity references for each purchase order type
D. using a servlet-based endpoint instead of the EJB based endpoint
Answer: B, C
Question: 38
Which two can be used for fine-grained access controls in a servlet-based Web service endpoint?
(Choose two.)
A.
B.
C.
D.
Use HTTPS with mutual authentication for all data exchanges.
Use the isUserInRole method to check if the authenticated user is in the logical role.
Use the getUserPrincipal method to check the Principal for the authenticated user.
Place the WSDL file in the WEB-INF/classes directory to secure the Web service from
invocation by malicious clients.
Answer: B, C
Question: 39
Which two statements are true about Web services using HTTP transport? (Choose two.)
A. Web service messages can be lost in transit.
B. Web service messages cannot be lost in transit.
C. The integrity of Web service messages is guaranteed.
D. The integrity of Web service messages is NOT guaranteed.
Answer: A, D
Page 12 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 40
Exhibit:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>
Message does not have necessary info
</faultstring>
<faultactor>http://gizmos.com/order</faultactor>
<detail>
<PO:order xmlns:PO="http://gizmos.com/orders/">
Quantity element does not have a value
</PO:order>
<PO:confirmation xmlns:PO="http://gizmos.com/confirm">
Incomplete address: no zip code
</PO:confirmation>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Which two code snippets retrieve the faultcode, faultstring, and faultactor from the message?
(Choose two.)
A. SOAPFault newFault = body.getFault();
Name code = newFault.getFaultCodeAsName();
String string = newFault.getFaultString();
String actor = newFault.getFaultActor();
B. SOAPFault newFault=body.getFault();
Element code = newFault.getElementsByTagName("faultcode");
Element string =
newFault.getElementsByTagName("faultstring");
Element actor =
newFault.getElementsByTagName("faultactor");
C. SOAPFault newFault = body.getFault();
NodeList code = newFault.getElementsByTagName("faultcode");
NodeList string =
newFault.getElementsByTagName("faultstring");
NodeList actor =
newFault.getElementsByTagName("faultactor");
D. Node newFault =body.getElementsByTagName("SOAP-ENV:Fault");
Node code = newFault.getElementsByTagName("faultcode");
Node string = newFault.getElementsByTagName("faultstring");
Node actor = newFault.getElementsByTagName("faultactor");
Answer: A, C
Question: 41
Given:
5. HelloIF_Stub stub = (HelloIF_Stub)
6. (new HelloWorldService_Impl().getHelloIFPort());
7. stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY,
Page 13 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
8. System.getProperty("endpoint"));
9. String callBack = stub.sayHelloBack("JAXRPC Sample");
10. System.out.println(callBack);
Which line(s) result in the first remote call?
A. line 9
B. line 10
C. lines 7 and 8
D. lines 5 and 6
Answer : A
Question: 42
A developer is writing a one-way Web service. An error occurs when the service executes.
Which is true about the Web service?
A. It must time-out.
B. It can send a SOAP fault back to the sender.
C. It must send a SOAP fault back to the sender.
D. It must NOT send a SOAP fault back to the sender.
Answer : D
Question: 43
An organization has all its Web services published in a UDDI registry.
Which two are true? (Choose two.)
A.
B.
C.
D.
All services interoperate with each other.
Applications can look up services in the registry server and reuse them.
It allows for loose coupling between services interacting with each other.
Applications using the UDDI registry must specify the business process required to gain
access to the published services.
Answer: B, C
Question: 44
What is an advantage of using XML to represent enterprise data?
A.
B.
C.
D.
It is compact.
It is self-describing.
The code used to parse XML can be reused on all platforms that accepts XML.
The overhead required to serialize and deserialize XML data is relatively low compared to
binary data representations.
Answer : B
Question: 45
A J2EE application contains business logic composed of EJB components. All current clients are
Java applications accessing the business logic using RMI. Some clients are remote (running in
different JVMs) and some are local (running in the same JVM).
Which two will be true if the EJB components are exposed as Web services? (Choose two.)
A. Declarative security can be used for all clients.
B. Current local clients must switch from RMI to Web service access.
C. Non-Java clients can access the business logic using Web services.
Page 14 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. Current remote clients must switch from RMI to Web service access.
Answer: A, C
Question: 46
A Web service that is implemented as a servlet-based endpoint can maintain state in the
HttpSession object by implementing which interface?
A. javax.rmi.Remote
B. javax.xml.rpc.Service
C. javax.servlet.ServletContext
D. javax.xml.rpc.server.ServiceLifecycle
Answer : D
Question: 47
A stateful business process needs to be exposed as a Web service that is implemented as an
EJB based endpoint.
What can be used for maintaining state in the Web service?
A. the container-generated EJBHome and EJBLocalHome
B. the container-generated EJBObject and EJBLocalObject
C. a custom mechanism that associates Web service messages using a correlation-id
D. the Enterprise Beans' EJBContext that is accessed using the getCallerIdentity method
Answer : C
Question: 48
What is the function of the SESSION_MAINTAIN_PROPERTY that is defined in the
javax.xml.rpc.Call interface?
A. This property instructs the JAX-RPC runtime to implement the service endpoint as a servlet.
B. This property indicates to a service if a client wants to participate in a session with the service
endpoint.
C. This server-side property is used by the client to find out if a server can participate in a
stateful exchange.
D. This property instructs the EJB container to implement the service endpoint as a stateful
session EJB component.
Answer : B
Question: 49
A developer has a requirement to expose a stateful business process using a Web service.
Which is true?
A.
B.
C.
D.
The Web service cannot be WS-I Basic Profile 1.0a compliant.
The developer can use the conversational features provided by servlet-based endpoints.
The developer can use an EJB based endpoint that uses container-managed sessions.
The developer cannot use JAX-RPC, since it prohibits exposing stateful business
functionality in a Web service.
Answer : B
Question: 50
Page 15 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
To accept multiple types of XML documents, which two types can be used by WSDL 1.1 part
element? (Choose two.)
A. xsd:qname
B. xsd:anyURI
C. xsd:string
D. xsd:anyType
Answer: C, D
Question: 51
An enterprise has a requirement to create a Web service to accept purchase orders. The order
data contains some authorization information that is specific to each order (such as, who can
access which parts of the order).
Keeping in mind future enhancements in types of orders that the enterprise needs to accept,
which two design strategies provide the most flexibility? (Choose two.)
A. a Web service interface with one method per accepted XML document type for a purchase
order
B. a procedure-style Web service method that lists all data elements and all possible access
control options
C. a document-style Web service method that accepts all types of XML documents representing
purchase orders
D. a Web service interface with one method for each combination of data elements and the
access control options
Answer: A, C
Question: 52
A chess website lets its users play chess with other players on the Internet. The website needs to
add a new web method that lets members write simple programs to observe an ongoing game.
The Web service uses the game ID and the move ID (0 for the last played move) as the input,
and returns the corresponding move.
Which Web service method offers the least complex solution and has the best performance?
A. a procedure-style Web service method that takes the game ID and the move ID as input, and
returns a string for the move
B. a document-style Web service method that takes an XML document containing the game ID
and the move ID as input, and returns an XML document containing the move
C. an asynchronous procedure-style Web service method that takes integer parameters game
ID and the move ID, and a Web reference for callback as input; the server sends a string for
the move at a later time for all the callbacks
D. an asynchronous document-style Web service method that takes an XML document
containing the game ID, the move ID, and a web reference for the callback as input; the
server sends an XML document containing the move at a later time for all the callbacks
Answer : A
Question: 53
A Web service needs to validate the credit rating for a loan. The service requires a social security
number, full name, and date of birth as input and returns one of many possible documents. Which
is true?
A. The developer must use an EJB based endpoint.
B. The developer must use a procedure-style Web service.
Page 16 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
C. The developer must use a document-style Web service.
D. The developer can use a procedure-style or document-style Web service.
Answer : D
Question: 54
A developer is writing a Web service method that needs to accept multiple types of requests.
Based on the request's content, the service performs time-consuming steps, such as verifying the
user's account, checking credit ratings, and building a list of offers.
Which approach should be used by the developer?
A. a synchronous, document-style approach
B. a synchronous, procedure-style approach
C. an asynchronous, document-style approach
D. an asynchronous, procedure-style approach
Answer : C
Question: 55
Based on separation of concerns, which two are best done in the interaction layer for a Web
service? (Choose two.)
A. validation of XML documents
B. saving document contents in a database table
C. application of the business logic to the XML document
D. translation of incoming XML documents to their internal XML representations
Answer: A, D
Question: 56
Based on separation of concerns, which two are best done in the processing layer of a Web
service? (Choose two.)
A. validation of XML documents
B. saving document contents in a database table
C. application of the business logic to the XML document
D. translation of incoming XML documents to their internal XML representations
Answer: B, C
Question: 57
A developer has a requirement to expose a Web service interface to an existing order processing
system.
Which is the appropriate design?
A.
B.
C.
D.
only a new interaction layer
only a new processing layer
a new interaction layer and a new processing layer
a new interaction layer and a facade processing layer that use the existing order processing
system
E. a new processing layer and a facade interaction layer that use the existing order processing
system
Answer : D
Page 17 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 58
A Web service needs to encrypt certain SOAP headers when responding.
Which is true?
A. The Web service interaction layer is the appropriate place for such encryption.
B. The Web service processing layer is the appropriate place for such encryption.
C. Either the Web service interaction or processing layer are appropriate for such encryption.
D. Neither the Web service interaction nor processing layer are appropriate for such encryption.
Answer : A
Question: 59
Given:
5. File f = new File("stylesheet.xsl")
6. FileInputStream fis = new FileInputStream(f);
7. StreamSource src = new StreamSource(fis);
8. TransformerFactory tf = TransformerFactory.newInstance();
9. // insert code here
Which code fragment, inserted at line 9, enables the reuse of stylesheet.xsl to improve
performance?
A. Templates templates = tf.newTemplates(fis);
B. Templates templates = tf.newTemplates(src);
C. Transformer transformer = tf.newTransformer(src);
D. Transformer transformer = tf.newTransformer();
transformer.transform(src, result);
Answer : B
Question: 60
What is a benefit of validating an XML document on the sender's side?
It ensures that the recipients are able to validate the document.
It ensures that the document conforms to the document's schema.
It ensures that the recipients are able to map the document's elements to the same Java types.
It ensures that all types that are used in the document conform to the primitive types defined in
the XML schema specification.
Answer : B
Question: 61
Given:
15. SAXParserFactory spf = SAXParserFactory.newInstance();
16. DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
17. // insert code here
18. SAXParser sp = spf.newSAXParser();
19. DocumentBuilder db = dbf.newDocumentBuilder();
20. // insert code here
Which two code snippets, when inserted at lines 17 and 20, enable the SAXParser and
DocumentBuilder to validate using XML schemas? (Choose two.)
A. sp.setProperty(
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
in line 20
Page 18 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
B. dbf.setAttribute(
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
in line 20
C. sp.setProperty(
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
in line 17
D. spf.setValidating(true);
dbf.setValidating(true);
dbf.setAttribute(
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
in line 17
Answer: A, D
Question: 62
A customer's workflow application has many coarse-grained Web services that act on different
parts of the incoming purchase order. The purchase order document can evolve over a period of
time to include appropriate information for various suppliers. Each part of the workflow only
accesses parts of the document.
Which technique should be used to implement this workflow?
A.
B.
C.
D.
use a document-style processing model
use JAXB to map the incoming message to Java objects at each step
map the document manually to individual Java objects for further processing
map the incoming document to a database schema and write the business logic in entity
beans
Answer : A
Question: 63
Enterprise A invokes a Web service provided by enterprise B with some parameters, and
receives a response. A developer is making this interaction asynchronous so that A does not
have to wait for B to finish processing.
Which two actions must be taken to fulfill this requirement? (Choose two.)
A.
B.
C.
D.
establish a Web service endpoint for enterprise A to receive the response
partition the endpoint implementation in interaction and processing layers
convert all Web service methods to use XML documents as parameters and return values
embed a correlation identifier in the request so that enterprise B can associate the response
with it
Answer: A, D
Question: 64
A J2EE Web service is designed to be synchronous, request-response, and HTTP-based. New
business requirements indicate that the implementation store the request data to be batchprocessed. The new service only needs to send a message back to the client acknowledging
receipt of the data in the HTTP response.
Which J2EE technology can be added in the service implementation to facilitate this change?
A. JavaServer Faces (JSF)
B. Java Activation Framework (JAF)
Page 19 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
C. Remote Method Invocation using IIOP (RMI-IIOP)
D. Java Message Service (JMS) and Message Driven Beans (MDB)
Answer : D
Question: 65
A purchase order Web service is designed to be synchronous, request-response, and HTTPbased. The existing service processes the request immediately. Because of new business
requirements, the service can take up to ten days to perform a credit check before processing the
order.
Which two design changes need to be made? (Choose two.)
A. The client needs to use dynamic proxies instead of stubs.
B. The client needs to develop and deploy a Web service to accept callbacks.
C. The service only needs to change the WSDL from rpc-literal to document-literal.
D. The client and the service need to establish a mechanism to correlate the messages.
Answer: B, D
Question: 66
Which two situations provide a reason for converting an existing synchronous Web service
interaction to an asynchronous Web service interaction? (Choose two.)
A. A system needs to improve its availability.
B. A human approval step has been added to a business process.
C. A human approval step has been replaced by an in-house automated system.
D. An external Web service endpoint used in the business process is having availability problems.
Answer: B, D
Question: 67
For a J2EE component, which code fragment is the correct and portable way of accessing a Web
service?
A. // Use the service implementation class to get the Stub
OrderService_Impl impl = new OrderService_Impl();
Stub stub = (Stub) impl.getOrderServicePort();
OrderService port = (OrderService) stub;
// Call business method
Order myorder = port.getOrderDetails(OrderId);
B. Context ic = new InitialContext();
OrderServiceStub svc = (OrderServiceStub)
ic.lookup("java:comp/env/svc/OrderService");
// Lookup the Service Endpoint Interface
OrderService port = svc.getOrderServicePort();
// Call business method
Order myorder = port.getOrderDetails(OrderId);
C. Context ic = new InitialContext();
Service svc = (Service)
ic.lookup("java:comp/env/svc/OrderService");
// Lookup the Service Endpoint Interface
OrderService port = (OrderService)
svc.getPort(OrderService.class);
// Call business method
Order myorder = port.getOrderDetails(OrderId);
Page 20 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. ServiceFactory sf = ServiceFactory.newInstance();
QName qname = new QName("urn:OrderService","OrderSvc");
// Create service with the WSDL URL and the service qname
Service svc = sf.createService(wsdlURL, qname);
QName qnamePort = new QName("urn:OrderService",
"OrderService");
OrderService port = (OrderService) svc.getPort(qnamePort,
OrderService.class);
// Call business method
Order myorder = port.getOrderDetails(OrderId);
Answer : C
Question: 68
Which situation requires the client to use the Dynamic Invocation Interface to access the Web
service?
A. The client and the server are on different platforms.
B. The client has access to the stubs, but NOT to the WSDL.
C. The client has access to the WSDL, but NOT to the stubs.
D. The client does NOT have access to the WSDL or the stubs.
Answer : D
Question: 69
For a Web service client that is written in Java, which two can result in a RemoteException?
(Choose two.)
A. a SOAP fault
B. an incorrect configuration of stubs
C. an out-of-memory error on the client
D. a communication failure due to a network error
Answer: A, D
Question: 70
A Web service is developed using the J2EE API and deployed in a J2EE application.
Which two are true? (Choose two.)
A. The Web service has no knowledge of the client's programming model.
B. An EJB in another application server can consume this service only if the service is deployed
as a stateless session bean endpoint.
C. The Web service can always determine that the client is using stubs, Dynamic Invocation
Interface, or dynamic proxies to consume the service.
D. The SOAP requests generated by clients for this Web service are logically equivalent for
clients using stubs, Dynamic Invocation Interface, or dynamic proxies.
Answer: A, D
Question: 71
Which two encoding styles are legal according to the WS-I Basic Profile 1.0a? (Choose two.)
A. rpc-literal
B. rpc-encoded
C. document-literal
Page 21 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. document-encoded
Answer: A, C
Question: 72
Which two are true about SOAP encoding of compound values? (Choose two.)
A. Compound values cannot be encoded.
B. A compound value should only be encoded as a single reference.
C. Members of a compound value are encoded as accessor elements.
D. Accessors with names that are local to their containing types have unqualified names.
Answer: C, D
Question: 73
According to the JAX-RPC 1.1 specification, which two are true with respect to SOAP 1.1 header
block processing? (Choose two.)
A. A header block can be processed by one or more JAX-RPC handlers.
B. All header blocks must be processed before a Web service endpoint can return a response.
C. Information in a header block can be passed to a service endpoint implementation as a
parameter for processing.
D. An intermediary may choose NOT to process a mandatory header block if it does NOT
understand the header block.
Answer: A, C
Question: 74
Which two statements are true? (Choose two.)
A. A header block targeted to an intermediary node must be forwarded to the next node.
B. A header block targeted to an intermediary node must NOT be forwarded to the next node.
C. An intermediary in a SOAP message exchange cannot add additional headers to a SOAP
message.
D. An intermediary in a SOAP message exchange can add additional header blocks to a SOAP
message.
Answer: B, D
Question: 75
Which describes the use of the SOAP 1.1 actor attribute?
A. It is ignored.
B. It indicates the recipient of a header block.
C. It indicates the final recipient of the message.
D. It indicates which recipient processes the Body element.
Answer : B
Question: 76
Which two fault codes are specified by the SOAP 1.1 specification? (Choose two.)
A. Fault
B. Client
C. Server
Page 22 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. Header
Answer: B, C
Question: 77
According to the WS-I Basic Profile 1.0a, what are three valid child elements of a Fault element?
(Choose three.)
A. actor
B. detail
C. faultcode
D. faultdetail
E. faultstring
Answer: B, C, E
Question: 78
Which describes SOAP attachments?
A. They must be compressed.
B. They must be serialized to XML.
C. They can contain binary format data.
D. They can be contained in the SOAP body.
Answer : C
Question: 79
Given:
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<!- insert envelope contents here -->
</soap:Envelope>
Which two XML fragments, when inserted into this soap:Envelope, result in a
WS-I Basic Profile 1.0a conformant SOAP message? (Choose two.)
A. <soap:Body>
<tns:Person xmlns:tns="http://sun.cert/types">
<name>Fred</name>
</tns:Person>
<age>33</age>
</soap:Body>
B. <soap:Body>
<tns:Person xmlns:tns="http://sun.cert/types">
<name>Fred</name>
<age>33</age>
</tns:Person>
</soap:Body>
C. <soap:Body>
<tns:Person xmlns:tns="http://sun.cert/types">
<name>Fred</name>
</tns:Person>
</soap:Body>
<soap:Header>
<t:id xmlns:t="http://sun/cert/types">6</t:id>
</soap:Header>
Page 23 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. <soap:Header>
<t:id xmlns:t="http://sun/cert/types">6</t:id>
</soap:Header>
<soap:Body>
<tns:Person xmlns:tns="http://sun.cert/types">
<name>Fred</name>
</tns:Person>
</soap:Body>
E. <soap:Header>
<t:id xmlns:t="http://sun/cert/types">6</t:id>
</soap:Header>
<age>33</age>
<soap:Body>
<tns:Person xmlns:tns="http://sun.cert/types">
<name>Fred</name>
</tns:Person>
</soap:Body>
Answer: B, D
Question: 80
According to the WS-I Basic Profile 1.0a, which is true about the SOAP 1.1 encodingStyle
attribute?
A.
B.
C.
D.
It can occur anywhere in a message.
It can only be declared on children Header elements.
It can be declared on any children of the Body element of rpc-literal messages.
It cannot be used with elements qualified by the http://schemas.xmlsoap.org/soap/envelope
namespace.
Answer : D
Question: 81
According to the WS-I Basic Profile 1.0a, which restriction is placed on processing mandatory
header blocks?
A. A receiver can ignore the mandatory header.
B. All of the headers must be processed at one time.
C. A receiver must handle messages in such a way that it appears that all checking of
mandatory header blocks is performed before any actual processing.
D. A receiver must NOT handle messages in such a way that it appears that all checking of
mandatory header blocks is performed before any actual processing.
Answer : C
Question: 82
According to WS-I Basic Profile 1.0a, which two restrictions are placed on WSDL 1.1? (Choose
two.)
A. Operation name overloading is NOT allowed in a WSDL portType.
B. WSDL portType in a description must NOT have distinct values for its name attribute.
C. The WSDL portType definition must NOT use solicit-response and notification style
operations.
D. A WSDL portType in a description must specify both type and element attributes on the same
WSDL part.
Page 24 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer: A, C
Question: 83
According to WS-I Basic Profile 1.0a, which two restrictions are placed on SOAP 1.1? (Choose
two.)
A. Children of the Body element must be namespace qualified.
B. The xsi:type attribute must be specified on the children of the Body element.
C. The value of the mustUnderstand attribute on a Header element must be "1" or "0".
D. The value of the mustUnderstand attribute on the Header element must be "true" or "false".
Answer: A, C
Question: 84
What is a characteristic of a document-style Web service?
A.
B.
C.
D.
It requires a rigid contract.
It cannot make full use of XML.
It is the only option available for asynchronous messaging.
It can be used to replace multiple parameters in a Web service method with a single
parameter.
Answer : D
Question: 85
Which is true about a JAX-RPC SOAP handler?
A. Its methods are invoked by a JAX-RPC HandlerChain.
B. It must be deployed on both the client and server endpoint.
C. It must maintain state, based on the content of SOAP messages.
D. It is destroyed if any of its methods throw a SOAPFaultException.
Answer : A
Question: 86
What are two characteristics of SOAP 1.1? (Choose two.)
A. It specifies rules to serialize various types.
B. It requires HTTP be used to exchange data.
C. It specifies how to bind schemas to Java classes.
D. It specifies how to exchange information in a distributed environment.
Answer: A, D
Question: 87
What is the purpose of a WSDL 1.1 document?
A. It defines an XML-based structure for describing Web service endpoints.
B. It defines an XSLT-based structure for describing Web service endpoints.
C. It defines an XML-based lightweight message protocol that is used by Web service endpoints.
D. It defines an XSLT-based lightweight message protocol that is used by Web service endpoints.
Answer : A
Page 25 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 88
What is the purpose of the binding element in a WSDL 1.1 document?
A. It defines a collection of related endpoints.
B. It defines the IP address of the machine where the service is deployed.
C. It defines an abstract, typed definition of the data that is being communicated.
D. It defines a concrete protocol and data format specification for a particular port type.
Answer : D
Question: 89
According to the WS-I Basic Profile 1.0a, if the use attribute of the WSDL 1.1 SOAP binding body
element is omitted, what is its default value?
A. rpc
B. literal
C. encoded
D. document
Answer : B
Question: 90
Which two describe the HTTP protocol-specific information that can be defined in a WSDL 1.1.
document? (Choose two.)
A. an address for the port
B. an address for the message queue
C. an indication that the service is deployed behind a firewall
D. an address relative to the base address defined by the port
Answer: A, D
Question: 91
According to the WS-I Basic Profile 1.0a, what are two restrictions placed on WSDL 1.1? (Choose
two.)
A. The use attribute must be literal in a body element.
B. The use attribute must be encoded in a body element.
C. The style attribute must be literal in a binding element.
D. The operation signatures must be unique in a binding element.
Answer: A, D
Question: 92
According to the WS-I Basic Profile 1.0a, which is true about the restriction placed on the WSDL
arrayType?
A. It can only be used by array declaration wrappers.
B. It must be used as an attribute in an array declaration.
C. It must NOT be used as an attribute in an array declaration.
D. It must be used as the value of the type attribute in an array declaration wrapper.
Answer : C
Question: 93
Page 26 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Given that the immediate child element of the WSDL 1.1 types definition is schema. What value
must be assigned to the targetNamespace attribute of the schema element?
A. It must be a valid URI.
B. It must be an empty string.
C. The same value as the schemaLocation attribute.
D. No value. The targetNamespace attribute must be omitted.
Answer : A
Question: 94
Which element is used to define new XML Schema complex types within a WSDL 1.1 document?
A. types
B. message
C. portType
D. definitions
Answer : A
Question: 95
According to the WSDL 1.1 and WS-I Basic Profile 1.0a, which types definition uses an existing
schema?
A. <types>
<extend namespace="http://www.sun.com/jws"
location="http://www.sun.com/jws/my.xsd" />
</types>
B. <types>
<import namespace="http://www.sun.com/jws"
location="http://www.sun.com/jws/my.xsd" />
</types>
C. <types>
<xsd:schema targetNamespace="http://www.sun.com/jws">
<xsd:extend namespace="http://www.sun.com/scdjws"
location="http://www.sun.com/jws/my.xsd" />
</xsd:schema>
</types>
D. <types>
<xsd:schema targetNamespace="http://www.sun.com/jws">
<xsd:import namespace="http://www.sun.com/jws"
schemaLocation="http://www.sun.com/jws/my.xsd" />
</xsd:schema>
</types>
Answer : D
Question: 96
Which is true about WSDL 1.1?
A. It does NOT recommend a specific type system
B. It recommends the use of XSD as the type system.
C. It recommends the use of DTD as the type system.
D. It recommends the use of XSD and DTD as the type system
Page 27 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer : B
Question: 97
According to the WS-I Basic Profile 1.0a, which is a restriction placed on UDDI 2.03?
A. The accessPoint element must be used.
B. The hostingRedirector element must be used.
C. The bindingTemplate element must NOT be used.
D. The tModelInstanceDetails element must NOT be used.
Answer : A
Question: 98
Which two standard identification systems are UDDI 2.03 operators required to support? (Choose
two.)
A. UPC
B. ISBN
C. D-U-N-S
D. Thomas Register
Answer: C, D
Question: 99
Which is true about UDDI data structures?
A. All data structures include a categoryBag element.
B. The identifierBag element must associate a valid UUID with a data structure.
C. Only the businessEntity data structure includes the identifierBag element.
D. Some data structures do NOT have an identifierBag or categoryBag element.
Answer : D
Question: 100
According to the WS-I Basic Profile 1.0a, which UDDI type must be associated with a Model that
represents a WSDL 1.1 document?
A. xmlSpec
B. wsdlSpec
C. soapSpec
D. categoryBag
Answer : B
Question: 101
What is the purpose of UDDI bindingTemplate?
A. It contains the single sign-on token.
B. It contains the information for invoking a registered business API.
C. It contains information about the service running behind a firewall.
D. It processes the runtime bindingTemplate information to retrieve the login token.
Answer : B
Question: 102
Page 28 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
What is the functionality of search APIs defined in the UDDI 2.04 specification?
A. It is impossible to perform a case-sensitive search on services.
B. It provides a mechanism to perform a case-sensitive search on services.
C. It provides a mechanism to get a list of current users on the UDDI registry.
D. It provides a mechanism to get a list of services ordered by their creation date.
Answer : B
Question: 103
According to UDDI 2.04, which protocol must be used to update, modify, or delete data structures
in a UDDI registry?
A. IIOP
B. HTTP
C. SMTP
D. HTTPS
Answer : D
Question: 104
Which two describe the UDDI Inquiry API? (Choose two.)
A. It requires user authentication.
B. It can be used to query the Internet.
C. It does NOT require user authentication.
D. It can be used to search a UDDI registry.
Answer: C, D
Question: 105
Which allows SOAP method calls to be assembled dynamically?
A. WSDL
B. CORBA IIOP
C. Dynamic proxies
D. Dynamic Invocation Interface
Answer : D
Question: 106
Which two are valid JAX-RPC clients? (Choose two.)
A. UDDI
B. JSPs
C. SOAP
D. WSDL
E. stateful session bean
Answer: B, E
Question: 107
Which two J2EE component technologies can be used to create Web services? (Choose two.)
A. servlets
Page 29 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
B. entity beans
C. stateful session beans
D. stateless session beans
Answer: A, D
Question: 108
According to the WS-I Basic Profile 1.0a, which two messaging styles must be supported?
(Choose two.)
A. rpc-literal
B. rpc-encoded
C. point-to-point
D. document-literal
E. publish-subscribe
Answer: A, D
Question: 109
Which three describe an EJB based endpoint? (Choose three.)
A. It can use HTTP sessions.
B. It can use J2EE declarative security.
C. It can use J2EE programmatic security.
D. It can use client-demarcated transactions.
E. It can use container-managed transactions.
Answer: B, C, E
Question: 110
Which three describe a servlet-based Web service endpoint? (Choose three.)
A. It can use HTTP sessions.
B. It can use J2EE declarative security.
C. It can use J2EE programmatic security.
D. It can use client-demarcated transactions.
E. It can use container-managed transaction.
Answer: A, B, C
Question: 111
A Web service provides two service methods. One method is for all company employees. The
other method is only for managers.
Which service endpoint type can be used with J2EE declarative security to build this Web
service?
A. servlet endpoint
B. stateless session bean endpoint
C. stateless session bean or servlet endpoint
D. no service endpoint types support this functionality
Answer : B
Question: 112
Which two are true of JAX-RPC Web services? (Choose two.)
Page 30 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A. EJB based endpoints are always invoked one thread at a time.
B. Servlet-based endpoints are always invoked one thread at a time.
C. EJB based endpoints may be invoked by multiple threads at the same time.
D. Servlet-based endpoints may be invoked by multiple threads at the same time.
Answer: A, D
Question: 113
Which three are true about JAX-RPC Web services? (Choose three.)
A. EJB based endpoints can use container-managed transactions.
B. Servlet-based endpoints can use container-managed transactions.
C. Client-initiated transactions are propagated to EJB based endpoints.
D. EJB based endpoints can programmatically demarcate transactions.
E. Client-initiated transactions are propagated to Servlet-based endpoints.
F. Servlet-based endpoints can programmatically demarcate transactions.
Answer: A, D, F
Question: 114
A developer needs to create a portable client for an existing Web service. The requirements state
that the client proxy must be able to catch service-specific exceptions. The developer has access
to the service endpoint interface.
Which type of proxy should the developer use?
A. dynamic proxy
B. generated stub
C. dynamic invocation interface
D. generated stub or dynamic proxy
Answer : A
Question: 115
A developer is given a WSDL for an existing Web service.
What is the correct sequence of steps that should 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. generate stubs and interfaces using JAXM, bind to the stubs, and then call methods on the
interface
C. generate stubs and interfaces using JAX-RPC, 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 : C
Question: 116
Which statement describes JAX-RPC Dynamic Interface Invocation (DII)?
A. DIl clients use typed interfaces to invoke the Web service.
B. DII lets clients access a Web service without a WSDL file.
Page 31 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
C. DII clients are bound at design-time to a single Web service.
D. DII requires the client to statically configure the Web service proxy.
Answer : B
Question: 117
Which two describe how a JAX-RPC client uses sessions? (Choose two.)
A. by setting the -f:wsi flag when using wscompile to generate the static stub
B. by setting the javax.xml.rpc.session.maintain property in the Stub interface
C. by setting the javax.xml.rpc.session.maintain property in the Call interface
D. by invoking the getSession() method in the javax.servlet.http.HttpServletRequest interface
Answer: B, C
Question: 118
A developer is creating a Web service that supports user sessions. A requirement specifies that
the user session must expire in 120 seconds.
Which XML entry must be made in the web deployment descriptor for the service endpoint to
satisfy this requirement?
A. <scope timeout="2">session</scope>
B. <session-timeout>2</session-timeout>
C. <session-timeout>120</session-timeout>
D. <stateful scope="session" timeout="120"/>
Answer : B
Question: 119
A developer needs to write a Web service that supports user sessions that timeout after 120
seconds.
Which configuration file should the developer use?
A. web.xml
B. server.xml
C. ejb-jar.xml
D. service-config.xml
Answer : A
Question: 120
A developer has a requirement to create a Java Web service client for an existing WS-I Basic
Profile 1.0a compliant Web service deployed on a non-Java platform.
Which is the correct mapping approach?
A. RMI
B. Handlers
C. WSDL-to-Java
D. Java-to-WSDL
Answer : C
Question: 121
A developer creates an endpoint interface for an existing stateless session bean.
Which is the correct mapping approach?
Page 32 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A. RMI
B. Handlers
C. WSDL-to-Java
D. Java-to-WSDL
Answer : D
Question: 122
A developer has a requirement to create a JAX-RPC client for an existing WS-I Basic Profile 1.0a
compliant Web service in a heterogeneous environment.
Which is the correct mapping approach?
A. RMI
B. Handlers
C. WSDL-to-Java
D. Java-to-WSDL
Answer : C
Question: 123
A developer is writing a Web service that is dependent on a legacy system. The legacy system
occasionally requires human interaction to complete its process.
What should the interaction mode of the Web service be?
A. synchronous
B. asynchronous
C. solicit-response
D. request-response
Answer : B
Question: 124
A developer is writing a Web service that adds an item to an unordered queue. Bandwidth
utilization must be minimized. There are no other requirements.
Which connection mechanism should the developer choose?
A. one-way RPC
B. solicit-response
C. synchronous messaging
D. request-response document
Answer : A
Question: 125
When using SOAP with the HTTP protocol, which is true?
A. One-way RPC sends an HTTP response back to the client.
B. One-way RPC does NOT send an HTTP response back to the client.
C. Synchronous request-response guarantees ordering of requests from multiple clients.
D. Asynchronous request-response does NOT send an HTTP response back to the client.
Answer : A
Question: 126
Page 33 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A developer is writing a Web service that adds an item to an ordered queue. Within the service
call there is no need to consult any back-end systems. Clients must be told their position in the
queue as soon as possible. There are no other requirements.
Which connection mechanism should the developer choose?
A. notification Web service messaging
B. synchronous Web service messaging
C. one-way RPC Web service messaging
D. solicit-response Web service messaging
Answer : B
Question: 127
Which connection mode allows a JAX-RPC client to make a Web service method call and then
continue processing in the same thread, without waiting for a response?
A. call-back
B. solicit-response
C. request-response
D. non-blocking RPC
Answer : D
Question: 128
What is a function of JAX-RPC handlers?
A. translate WSDL
B. manipulate HTTP headers
C. enforce SSL requirements
D. manipulate message headers
Answer : D
Question: 129
Which two actions must a developer perform to define a handler chain for an EJB based
endpoint? (Choose two.)
A. extend JAX-RPC HandlerInfo
B. specify a service-ref element
C. define the order in which the handlers are invoked
D. create a webservice.xml deployment descriptor
Answer: C, D
Question: 130
Which describes the SAAJ API?
A. It is used as an alternative to SOAP.
B. It cannot be used to modify SOAP messages.
C. It is used to generate Java bindings from WSDL.
D. It is used by message handlers to manipulate SOAP headers.
Answer : D
Question: 131
Page 34 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
When working with a JAX-RPC message handler chain, which is true?
A. None of the handlers in a chain can modify the SOAP headers.
B. Only the first handler in a chain can modify the SOAP headers.
C. Handlers processing incoming messages are invoked in the same order as handlers
processing outgoing messages.
D. Handlers processing incoming messages are invoked in the reverse order as handlers
processing outgoing messages.
Answer : D
Question: 132
When working with EJB based endpoints, which is true?
A. They must use JAAS.
B. They can use message handlers.
C. They must use message handlers.
D. They cannot use message handlers.
Answer : B
Question: 133
A developer has a requirement to extract the XML namespace of an element using SAX2.
Which method must be used?
A. characters
B. endDocument
C. endPrefixMapping
D. startPrefixMapping
Answer : D
Question: 134
A developer is using the XSLT APIs in JAXP 1.2. A TransformerFactory object is instantiated and
used to create a Transformer. A Source object is used as the input to the Transformer.
Which two are true? (Choose two.)
A. The Source object must be created from a SAX reader or from a DOM node.
B. The Source object can be created from a SAX reader, a DOM node, or an InputStream.
C. If the Transformer is created without any specific instructions, then it copies the Source to the
Result.
D. If the Transformer is created without any specific instructions, then it throws a
TransformerException.
Answer: B, C
Question: 135
A developer is creating an application where an XML file needs to be parsed to access only a
single element.
Which technology should be used to minimize memory requirements?
A. XSLT
B. JAXB
C. SAX2
D. DOM Level 2
Page 35 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer : C
Question: 136
A company receives orders as XML documents. When the order is received and the XML
document is processed, the document instance itself is not needed for further processing.
Which technology should the developer use to process the order?
A. JAXB
B. JDBC
C. SAAJ
D. JAX-RPC
Answer : A
Question: 137
A Web service needs to translate XML documents received from external partners to internal
XML representations.
What can the developer use to implement the service?
A. XSLT
B. JDBC
C. SAAJ
D. JAX-RPC
Answer : A
Question: 138
What can be used to create an application that uses vendor-independent XML parsing APIs?
A. JAXP
B. JAXB
C. DOM4J
D. JAX-RPC
Answer : A
Question: 139
A developer is using the SAX parser to extract the value of an element in an XML document.
Which method should be used?
A. endElement
B. characters
C. startElement
D. startPrefixMapping
Answer : B
Question: 140
Which three describe the JAXB binding compiler? (Choose three.)
A. It is used only at compile time and accepts an XML schema as an input.
B. It reads an XML schema and generates the corresponding Java class files.
C. It is used instead of the Java compiler to add XML binding information to the classes.
Page 36 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. It generates Java interfaces using standard XML data type mapping and runtime-specific
implementations.
E. It generates Java interfaces using standard XML data type mapping, and developers must
provide their implementations.
Answer: A, B, D
Question: 141
Which three describe unmarshal-time validation in JAXB? (Choose three.)
A.
B.
C.
D.
It must be supported by all JAXB implementations.
It is invoked using the Validator.validate method.
It is enabled or disabled using the Unmarshaller.setValidating method.
It enables a application to receive information about validation errors and warnings that are
detected while unmarshalling a Java content tree into XML.
E. It enables an application to receive information about validation errors and warnings that are
detected while unmarshalling XML data into a Java content tree.
Answer: A, C, E
Question: 142
Which three describe the on-demand validation in JAXB API? (Choose three.)
A. It must be supported by all JAXB implementations.
B. It is only available to the JAXB implementation and is not available to client applications.
C. It enables an application to validate the Java content tree based on schema validation
constraints.
D. It enables an application to receive immediate feedback about modifications to a Java
content tree.
E. It enables an application to receive information about validation errors and warnings that are
detected in the Java content tree.
Answer: AC E
Question: 143
Given:
8. public void marshallCollection(Collection collection)
9. throws Exception {
10. JAXBContext context = JAXBContext.newInstance("test.jaxb");
11. Marshaller marshaller = context.createMarshaller();
12. marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
13. new Boolean(true));
14. marshaller.marshal(collection,
15. new FileOutputStream("jaxbFile"));
16. }
What is the functionality of the code?
A.
B.
C.
D.
It marshals the data contained in jaxbFile to collection.
It marshals the data contained in jaxbFile to collection with line breaks and indentation.
It marshals the data contained in the collection to jaxbFile with line breaks and indentation.
It marshals the data contained in collection and creates a Java class file called jaxbFile with
proper code formatting.
Answer : C
Page 37 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 144
Which chain of method calls returns a SOAPBody object?
A. SOAPMessage soapMsg = new SOAPMessage();
soapMsg.getSOAPBody();
B. SOAPMessage soapMsg = SOAPMessage.newInstance();
soapMsg.getSOAPBody();
C. MessageFactory msgFactory = new MessageFactory();
msgFactory.createMessage().getSOAPBody();
D. MessageFactory msgFactory = MessageFactory.newInstance();
msgFactory.createMessage().getSOAPBody();
Answer : D
Question: 145
Which is a super type of the javax.xml.soap.SOAPBody type?
A. java.lang.String
B. org.w3c.dom.Node
C. org.w3c.dom.Document
D. javax.xml.soap.SOAPEnvelope
Answer : B
Question: 146
Given the SAAJ 1.1 code snippet:
10. Name name = soapFactory.createName("symbol");
11. SOAPElement symbol = bodyElement.addChildElement(name);
12. symbol.addTextNode("SUNW");
Which XML fragment is added to the SOAP message?
A. <symbol>SUNW</symbol>
B. <name>symbol:SUNW</name>
C. <SOAP-ENV:Body>
<symbol>SUNW</symbol>
</SOAP-ENV:Body>
D. <SOAP-ENV:symbol>
<name>SUNW</name>
</SOAP-ENV:symbol>
Answer : A
Question: 147
Given:
10. SOAPHeader header = message.getSOAPHeader();
11. Name headerName = soapFactory.createName("Claim",
12. "wsi", "http://ws-i.org/schemas/conformanceClaim/");
13. SOAPHeaderElement headerElement =
14. header.addHeaderElement(headerName);
15. headerElement.addAttribute(soapFactory.createName(
16. "conformsTo"), "http://ws-i.org/profiles/basic1.0/");
What is the functionality of the code?
A. It retrieves the SOAPHeader object from a message and adds a new SOAPHeaderElement
object to it.
Page 38 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
B. It retrieves the SOAPHeader object from the SOAP-ENV, assigns a new attribute to it, and
creates a new message.
C. It creates a new SOAPHeaderElement object, assigns it to a new SOAPHeader object, and
creates a new message.
D. It creates a SOAPHeader object, assigns a new SOAPHeaderElement object to it, and
assigns the new SOAPHeader object to a message.
Answer : A
Question: 148
Which describes the SAAJ API?
A. It is used to parse XML schemas.
B. It is used for unmarshalling WSDL documents to Java classes.
C. It is used for manipulating SOAP messages in JAX-RPC handlers and JAXR
implementations.
D. It mandates the use of the SOAPConnection object and marshals the data contained in Java
classes to create WSDL documents.
Answer : C
Question: 149
Given:
20. AttachmentPart attach =
21. soapMessage.createAttachmentPart(someObject);
22. soapMessage.addAttachmentPart(attach);
Which is the correct type used for the someObject parameter of the createAttachmentPart
method call?
A. javax.activation.MimeType
B. javax.activation.DataHandler
C. javax.activation.FileTypeMap
D. javax.activation.ActivationDataFlavor
Answer : B
Question: 150
Which two describe JAXR 1.0 ? (Choose two.)
A. It provides an alternative to JNDI for Enterprise JavaBeans components.
B. It provides the least common denominator for diverse registry specifications and standards.
C. It defines a pluggable provider architecture that supports diverse registry specifications and
standards.
D. It supports a union of the best features of dominant registry specifications, rather than a
common intersection of features.
Answer: C, D
Question: 151
Which describes 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 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.
Page 39 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer : D
Question: 152
Which describes the mapping of UDDI categoryBag and businessEntity elements in JAXR 1.0 ?
A. The categoryBag is mapped to JAXR Concept, and businessEntity is mapped to a JAXR
Service.
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 Organizations, and businessEntity is
mapped to JAXR Classifications.
D. The categoryBag is mapped to JAXR Collection of Classifications, and businessEntity is
mapped to JAXR Organization.
Answer : D
Question: 153
Which two are true about JAXR 1.0? (Choose two.)
A.
B.
C.
D.
Every JAXR RegistryObject has a unique key.
It provides interfaces for managing life cycle of registry objects.
It provides a businessEntity data structure for storing publisher assertions.
It provides a bindingTemplate interface that is used to determine if a service is deployed
behind a firewall.
Answer: A, B
Question: 154
Which is true about J2EE 1.4 compatible application servers?
A. They must support at least Level 0 of the JAXR 1.0 API.
B. They must support at least Level 1 of the JAXR 1.0 API.
C. They must support both Level 0 and 1 of the JAXR 1.0 API.
D. They are NOT required to support either Level 0 or Level 1 of the JAXR 1.0 API.
Answer : A
Question: 155
A developer intends to use JAXR to update information in a UDDI registry.
Which describes JAXR?
A. It requires the use JAX-RPC APIs.
B. It only allows clients to perform inquiries.
C. It provides a layer of abstraction over the particular registry provider.
D. It allows clients to delete entries in the UDDI registry that were not created by them.
Answer : C
Question: 156
Which describes the JAXR 1.0 BusinessQueryManager object?
A. It can only be used with UDDI registries.
B. It allows clients to search for information through interfaces defined in JAXR infomodel.
Page 40 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
C. It allows clients to search and update information through interfaces defined in JAXR
infomodel
D. It mandates the implementation of DeclarativeQueryManager, allowing clients to use SQL
syntax for queries.
Answer : B
Question: 157
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 J2SE implementation of JAXR 1.0. The client creates a
set of properties that specify the proxy host and port information for the network in which the
client is running.
Which describes the remaining steps required by the JAXR client to connect to the UDDI
registry?
A. It assigns the properties to a connection factory and creates the connection.
B. It specifies the URL of the UDDI registry in the properties, assigns the properties to a
connection factory, and creates the connection.
C. It specifies the URL of the UDDI registry in the properties, assigns the properties to a
connection factory, assigns the properties to a service binding, and creates the connection.
D. It specifies the URL for the UDDI registry and the tModel in the properties, specifies the
search criteria for services, assigns the properties to a service binding, and creates the
connection.
Answer : B
Question: 158
A JAXR client has established connection with a UDDI registry and needs to get a service binding
from the registry.
Which steps are required to accomplish this task?
A. find the appropriate concept and then find the service binding that is associated with that
concept
B. find the appropriate authentication token and then find the service binding that is associated
with that authentication token
C. find the appropriate organization, get the tModel associated with that organization, and then
find the service binding that is associated with the tModel
D. find the appropriate organization, find the services that are associated with that organization,
and then find the service binding that is associated with the service
Answer : D
Question: 159
Given:
10. binding.setValidateURI(false);
11. binding.setAccessURI("http://www.sun.com:8080/rt/");
This JAXR client interacts with a UDDI registry using binding as the JAXR ServiceBinding object.
Which correctly describes the code?
A. It is incorrect because setValidateURI cannot accept false as a parameter.
B. It allows the JAXR client to publish an incorrect URL for a service without an error.
C. It is incorrect because the setAccessURI cannot accept a URI with a port number.
D. It allows the JAXR client to redirect requests to an error page in case of an exception.
Page 41 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer : B
Question: 160
Which two describe the uses for JAXR 1.0 Concept? (Choose two.)
A. It can be used to parse a WSDL document for generating a corresponding Java class.
B. It can be used to define namespaces for external identifiers, such as D-U-N-S Numbers.
C. It can be used to define the hierarchical tree structure and detailed elements of a
ClassificationScheme.
D. It can be used to define the hierarchical tree structure of a ClassificationScheme, but cannot
be used for defining its detailed elements.
Answer: B, C
Question: 161
Which two statements are true about the properties used to configure a JAXR Connection
Factory? (Choose two.)
A. They cannot be configured by the client.
B. A JAXR provider may define a set of provider-specific properties.
C. Configuration properties must never be qualified by a package name.
D. There are a set of standard properties that all JAXR providers must support.
E. All of the properties are implementation-specific and vary between JAXR providers.
Answer: B, D
Question: 162
Which mechanism does a developer use to manage transactions in a servlet-based endpoint?
A. the Java Transaction API or a similar API
B. the built-in JAX-RPC runtime support for transactions
C. the declarative transaction elements defined in the deployment descriptor for web components
D. the declarative transaction elements defined in the deployment descriptor for EJB components
Answer : A
Question: 163
Which describes a J2EE security realm?
A.
B.
C.
D.
an individual (or application program) identity that is defined in the application server
a collection of users and groups that are controlled by the same authentication policy
an abstract name for the permission to access a particular set of resources in an application
a set of authenticated users that are classified by common traits and defined in the
application server
Answer : B
Question: 164
Which are J2EE components?
A. JMS, EJB, JSP
B. EJB, JSP, Servlet
C. JMS, JDBC, JAXR
D. JMS, JSP, JAX-RPC
Page 42 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Answer : B
Question: 165
Which two APIs are used to create J2EE components? (Choose two.)
A. EJB
B. JSP
C. JMS
D. JAXB
E. SAAJ
Answer: A, B
Question: 166
What are three benefits of using EJB based endpoints? (Choose three.)
A. support for client-initiated transactions
B. method-level, declarative access control
C. support for container-managed transactions
D. container-based, lifecycle management of endpoint instances
E. automatic support for long-lived sessions between a service and a service client
Answer: B, C, D
Question: 167
What are three benefits of using servlet-based endpoints? (Choose three.)
A. method-level, declarative access control
B. support for container-managed transactions
C. simpler programming model than EJB based endpoints
D. support for sessions between a service and service client
E. built-in support for both basic and mutual authentication mechanisms
Answer: C, D, E
Question: 168
What can a developer do to improve the interoperability of Web services developed using the
J2EE platform?
A. restrict access only to clients that can locate a service using JNDI
B. use only servlet-based endpoints when exposing services to non-Java clients
C. leverage the platform support for WS-I Basic Profile 1.0a when creating a service
D. add a service description element to the WSDL file that describes the service endpoint
Answer : C
Question: 169
Which two are required to be supported by a J2EE 1.4 compatible application server? (Choose
two.)
A. JAXB 1.0 technology for a web module
B. JAXP 1.2 technology for a Java applet client
C. JSP 2.0 and Servlet 2.4 technologies for an EJB module
D. JAX-RPC 1.1 and SAAJ 1.2 technologies for an EJB module
E. JAX-RPC 1.1 and SAAJ 1.2 technologies for a Java applet client
Page 43 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
F. JAX-RPC 1.1 and SAAJ 1.2 technologies for a J2EE application client
Answer: D, F
Question: 170
Which two are true about J2EE 1.4 compatible application servers? (Choose two.)
A. They must include a UDDI registry.
B. They must support the latest versions of all J2EE APIs.
C. They must include a JMS provider that supports point-to-point and publish-subscribe
messaging.
D. They allow developers to use multiple DOM implementations with no changes to the parsing
code.
Answer: C, D
Question: 171
Which is false?
A. A J2EE component accesses a purchase order Web service. The URL to access the
purchase order Web service can be changed while deploying the J2EE component.
B. A J2EE Web service method can invoke another Web service method by directly opening a
socket connection and exchanging SOAP messages.
C. A Web service endpoint can be reconfigured during deployment to use an alternate database
without changing its implementation code.
D. A J2EE Web service method invokes another Web service method deployed on the same
J2EE application server. The security context established because of HTTP basic
authentication must be passed to the second Web service invocation by the application
server.
Answer : D
Question: 172
While constructing a valid SOAPMessage object, which two are optional? (Choose two.)
A. SOAPPart
B. SOAPBody
C. SOAPHeader
D. SOAPEnvelope
E. AttachmentPart
Answer: C, E
Question: 173
For a SOAPMessage object, what can be in a format other than XML?
A. SOAPPart
B. SOAPBody
C. SOAPHeader
D. AttachmentPart
Answer : D
Question: 174
What is the JAX-RPC service endpoint interface?
Page 44 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A. an API to manipulate SOAP messages
B. an API to manipulate WSDL documents
C. the Java representation of a SOAP message used by a Web service
D. the Java representation of a Web service described by a WSDL document
Answer : D
Question: 175
Which two describe how the J2EE platform simplifies the use of JAXR? (Choose two.)
A. It supports declarative configuration of JAXR connection factory properties.
B. It provides an extensible typing system for data obtained from a variety of registry
implementations.
C. It allows a registry operator to proactively inform a registry client of changes to previously
accessed registry information.
D. It provides automatic lifecycle management of JAXR Connection objects obtained using a
connection factory accessed from JNDI.
Answer: A, D
Question: 176
Which is true about the J2EE 1.4 platform?
A. It requires support for the WS-I Basic Profile 1.0a.
B. It recommends support for the WS-I Basic Profile 1.0a.
C. It does NOT require support for the WS-I Basic Profile 1.0a.
D. It does NOT discuss support for the WS-I Basic Profile 1.0a.
Answer : A
Question: 177
Which is true about rpc-encoded messaging?
A. It is recommended by the WS-I Basic Profile 1.0a and it is supported by J2EE 1.4.
B. It is NOT recommended by the WS-I Basic Profile 1.0a, but it is supported by J2EE 1.4.
C. It is recommended by the WS-I Basic Profile 1.0a, but it is NOT supported by J2EE 1.4.
D. It is optional according to the WS-I Basic Profile 1.0a, and it is NOT supported by J2EE 1.4.
Answer : B
Question: 178
Given that a JAX-RPC client needs to support WS-I Basic Profile 1.0a, which is true about JAXRPC handlers?
A. They can be used to add a WS-I Basic Profile 1.0a conformance header block to outgoing
messages.
B. They must be used to add a WS-I Basic Profile 1.0a conformance header block to outgoing
messages.
C. They must NOT be used to add a WS-I Basic Profile 1.0a conformance header block to
outgoing messages.
D. They should NOT be used to add a WS-I Basic Profile 1.0a conformance header block to
outgoing messages.
Answer : A
Page 45 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 179
Which two are true about WS-I Basic Profile 1.0a? (Choose two.)
A. It does NOT address lower-layer internet protocols, such as TCP and IP.
B. It guarantees interoperability between WS-I Basic Profile 1.0a compliant services.
C. It assures that application semantics are understood by all services interacting with each
other.
D. It addresses the most common interoperability problems, but does NOT guarantee
interoperability between compliant services.
Answer: A, D
Question: 180
A developer writes a Web service that uses MIME binding.
Which is true?
A. The Web service cannot be deployed behind a firewall.
B. The Web service is compliant with WS-I Basic Profile 1.0a.
C. The Web service is NOT compliant with WS-I Basic Profile 1.0a.
D. The J2EE 1.4 platform prohibits the use of SOAP with attachments.
Answer : C
Question: 181
What are three benefits of using SSL to connect to a Web service without mutual
authentication? (Choose three.)
A. The server is assured of the client's identity.
B. The client is assured of the server's identity.
C. Data integrity is preserved between the client and the server.
D. The communication between the client and the server is logged.
E. The communication between the client and the server is encrypted.
Answer: B, C, E
Question: 182
Given a Web service requires basic authentication, what must a developer do when creating a
client that can access this Web service?
A. provide a SAML token
B. provide a digital certificate
C. provide a username and password
D. provide a username, password, and digital certificate
Answer : C
Question: 183
Which two mechanisms can a Web service, deployed in a J2EE 1.4 compatible application
server, use for authentication? (Choose two.)
A. HTTP digest authentication, where the client sends a one-way digest of the password
B. symmetric HTTPS, where both the client and server can authenticate each other by
requesting and verifying the X.509 certificate
Page 46 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
C. HTTP Basic Authentication, where the username and password are passed as HTTP
headers that are uu-encoded, but not encrypted
D. form-based authentication, where the username and password fields are passed using the
j_username and j_password respectively
Answer: B, C
Question: 184
Which three techniques describe how XML Digital Signatures can be applied to an XML
document? (Choose three.)
A. use detached signatures, where the digital signature covers sibling elements or external data
B. use enveloping signatures, where the digital signature element encloses the data to be
signed
C. use enveloped signatures, where the digital signature is a child element of the data to be
signed
D. use enveloping signatures, where the digital signature is a child element of the data to be
signed
E. use enveloping signatures, where the digital signature element is a child element of the data
to be signed
Answer: A, B, C
Question: 185
Given:
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<Reference URI="#Res0">
<!-- other elements here -->
</Reference>
<dsig:Object xmlns=""
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="Res0">
<purchaseorder>
<!-- other XML document elements here -->
</purchaseorder>
</dsig:Object>
</ds:Signature>
The digital signature described is applied using which technique?
A. attached
B. detached
C. enveloped
D. enveloping
Answer : D
Question: 186
Which two apply to digital signatures applied to an XML document? (Choose two.)
A. The receiver verifies that the message matches the digital signature using its own private
key.
B. The receiver verifies that the message matches the digital signature using the sender's public
key.
C. The sender creates a digital signature using its own private key and sends that signature
along with the original document.
Page 47 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. The sender creates a digital signature using its own public key and sends that signature
along with the original document.
Answer: B, C
Question: 187
Which security specification can be used to allow single sign-on across multiple Web services?
A. SSL
B. SAML
C. XKMS
D. XACML
Answer : B
Question: 188
Which three security technologies are included in WS-Security? (Choose three.)
A. auditing
B. encryption
C. single sign-on
D. security tokens
E. digital signatures
Answer: B, D, E
Question: 189
Which two are defined by SAML? (Choose two.)
A. a standard that describes an access control policy language for XML documents
B. a protocol by which clients can request assertions about subjects from SAML authorities
C. a standard for including digital signatures in SOAP messages for Web services that require
single sign-on
D. the structure of the XML documents that transport authentication and authorization
information between services
Answer: B, D
Question: 190
Which three security technologies are used by WS-Security? (Choose three.)
A. SAML
B. XACML
C. XML Encryption
D. XML Canonicalization
E. XML Digital Signatures
Answer: C, D, E
Question: 191
Which two operations are supported by an XML Key Management Specification (XKMS)
compliant service? (Choose two.)
A. generation, registration, and revocation of keys
B. retrieval of public keys and validation of certificates
Page 48 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
C. distribution and management of Kerberos service tickets
D. granting a Kerberos ticket granting ticket (TGT) to Web services
Answer: A, B
Question: 192
How does a JAX-RPC client specify usernames and passwords to use HTTP Basic
Authentication with a Web service?
A. by setting username and password properties in a Stub
B. by adding username and password parameters to a Call
C. by using a JAX-RPC handler to add usernames and passwords to the HTTP headers
D. by using a JAX-RPC handler to add usernames and passwords to the SOAP headers
Answer : A
Question: 193
An organization has business logic implemented in EJB components. Current clients use
container-managed, role-based security to access the business logic using RMI. Management
has determined that the business logic must be made available to non-RMI clients using a Web
service.
Which container-managed Web service security mechanism must the development team use to
allow Web service clients to use the current security model?
A. XKMS
B. XACML
C. XML Digital Signature
D. HTTP Basic Authentication
Answer : D
Question: 194
A company builds a Web service to process images. These images are large files that are sent as
SOAP attachments. Securing the images is not important. However, the accompanying SOAP
messages contain sensitive client data, including credit card numbers. A developer needs to
choose a security mechanism for this Web service.
Which security mechanism secures the sensitive data with the least overhead?
A. Kerberos
B. mutual authentication
C. message-level security
D. transport-level security
Answer : C
Question: 195
An automobile manufacturer publishes a Web service for use by their suppliers. The
manufacturer has stringent security requirements that require suppliers to verify their identity.
Data integrity and confidentiality must be maintained between the client and the server.
Which two meet all of these requirements? (Choose two.)
A. X.509 and XKMS
B. XACML and XKMS
C. SSL and mutual authentication
Page 49 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
D. XML Encryption and XML Digital Signature
Answer: C, D
Question: 196
Given:
10. <security-constraint>
11. <user-data-constraint>
12.
13. </user-data-constraint>
14. </security-constraint>
15. <login-config>
16.
17. </login-config>
A JAX-RPC Web service deployed in a web container is secured using HTTP Basic
Authentication over SSL.
Which XML elements need to be inserted at line 12 and line 16 inthe web.xml descriptor
respectively?
A. <transport-guarantee>INTEGRAL</transport-guarantee> and <auth-method>BASIC</authmethod>
B. <transport-guarantee>NONE</transport-guarantee> and <auth-method>CLIENTCERT</auth-method>
C. <transport-guarantee>CONFIDENTIAL</transport-guarantee> and <authmethod>BASIC</auth-method>
D. <transport-guarantee>CONFIDENTIAL</transport-guarantee> and
<auth-method>CLIENT-CERT</auth-method>
Answer : C
Question: 197
Given:
10. <security-constraint>
11. <user-data-constraint>
12.
13. </user-data-constraint>
14. </security-constraint>
15. <login-config>
16.
17. </login-config>
A JAX-RPC Web service deployed in a web container is secured using mutual authentication
over SSL.
Which XML element needs to be inserted at line 12 and line 16 inthe web.xml descriptor
respectively?
A. <transport-guarantee>HTTPS</transport-guarantee> and <auth-method>MUTUAL</authmethod>
B. <transport-guarantee>SECURED</transport-guarantee> and <auth-method>HTTPS</authmethod>
C. <transport-guarantee>CONFIDENTIAL</transport-guarantee> and <authmethod>BASIC</auth-method>
D. <transport-guarantee>CONFIDENTIAL</transport-guarantee> and
<auth-method>CLIENT-CERT</auth-method>
Answer : D
Page 50 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 198
What are two reasons for choosing message-level security in a Web service? (Choose two.)
A. to support the use of SSL
B. to support multiple transport protocols
C. to selectively encrypt message content
D. to remove security information from SOAP headers
Answer: B, C
Question: 199
A company uses a Web service to get daily reports from its remote offices. Only a small portion of
the data is sensitive. Therefore, the development team has chosen to encrypt only selected
elements within the XML document.
Which security mechanism allows selective encryption of a SOAP message?
A. SAML
B. XACML
C. WS-Security
D. XML Digital Signature
Answer : C
Question: 200
Which mechanism guarantees data integrity between a client and a Web service?
A. SAML
B. XACML
C. Basic Authentication
D. XML Digital Signature
Answer : D
Question: 201
Two companies communicate using Web services in a business transaction.
Which mechanism ensures that business data cannot be renounced, or a transaction denied, by
either one?
A. integrity provided by public key certificates and digital signatures
B. confidentiality provided by asymmetric or symmetric cryptography
C. identity management provided by private keys and certificate authorities
D. non-repudiation provided though public key cryptography by digital signing
Answer : D
Question: 202
Which four factors impact the security of a Web service deployed on the J2EE platform? (Choose
four.)
A. the use of intermediaries and SOAP nodes
B. the transport protocol used by the Web service
C. the transaction throughput processed by the service
D. the programming language used by the service consumer
E. the nonrepudiation requirements of the business transaction
Page 51 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
F. the use of the Web service in the context of business-to-business or EAI
Answer: A, B, E, F
Question: 203
Which correctly describes the element named jaxrpc-mapping-file in the webservices.xml
descriptor?
A. It points to a file that can only be created by the application deployer.
B. It points to a file that maps the container's configuration information to the corresponding
JAX-RPC properties.
C. It points to a file that must always be named jaxrpc-ri.xml and must always be placed in the
WEB-INF directory.
D. It points to a file that contains information that correlates the mapping between the Java
interfaces and the WSDL for the Web service.
Answer : D
Question: 204
Which is true about EJB based endpoints?
A. They are packaged in RAR files.
B. They are packaged in WAR files.
C. They are packaged in EJB JAR files.
D. They must NOT be packaged in EAR files.
Answer : C
Question: 205
Given that the handler element can be used in the deployment descriptor.
Which is true?
A. The handler element is only used in association with J2EE Web service endpoints, NOT
J2EE Web service clients.
B. The handler element is only used in association with J2EE Web service clients, NOT J2EE
Web service endpoints.
C. The sequence of sibling handler elements determines the order in which JAX-RPC Handler
objects are invoked in a handler chain.
D. The sequence of sibling handler elements does NOT determine the order in which JAX-RPC
Handler objects are invoked in a handler chain.
Answer : C
Question: 206
Which three are true for the JAXP APIs? (Choose three.)
A.
B.
C.
D.
E.
They are a part of J2SE 1.4.
They manipulate DOM trees using JDOM.
They do NOT support validation of XML documents against schemas.
They are a required API as a part of the J2EE 1.4 specification for the web and EJB tiers.
They provide developers with a vendor and parser-implementation independent API to
process XML.
Answer: A, D, E
Page 52 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 207
Given:
10. File xml = new File("purchaseorder.xml");
11. File xsl = new File("purchaseorder.xsl");
12.
Which code snippet inserted at line 12 causes the XSL stylesheet to be applied to the XML?
A. SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser obj = factory.newSAXParser();
obj.parse(xml,xsl);
B. DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
Transformer obj = factory.newTransformer(new StreamSource(xsl));
obj.parse(xml,xsl);
C. TransformerFactory factory =
TransformerFactory.newInstance();
DocumentBuilder obj = factory.newDocumentBuilder();
obj.transform(new StreamSource(xml), new StreamResult(System.out));
D. TransformerFactory factory =
TransformerFactory.newInstance();
Transformer obj =
factory.newTransformer(new(StreamSource(xsl)));
obj.transform(new StreamSource(xml), new StreamResult(System.out));
Answer : D
Question: 208
Given:
1. public void startElement(String namespaceURI, String localName,
2. String qName, Attributes atts){
3. System.out.println(localName);
4. }
5. <?xml version="1.0" encoding="UTF-8"?>
6. <soap:Envelope
7. xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" >
8. <soap:Body/>
9. </soap:Envelope>
A content handler implements the startElement method.
Which output would the handler generate using SAX2 to parse the XML document in lines 5-9?
A. Envelope
Body
B. soap:Envelope
soap:Body
C. Envelope
Body
Body
Envelope
D. soap:Envelope
soap:Body
soap:Body
soap:Envelope
Answer : A
Page 53 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 209
Given:
xmlns:xsd="http://schemas.xmlsoap.org/wsdl/"
xmlns:book="http://www.sun.com/books"
...
<xsd:schema targetNamespace="http://www.sun.com/books">
<xsd:element name="bookInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
These namespace aliases and schema appear in the WSDL file for a document-style Web
service.
Which is a valid message element for this WSDL file?
A. <message name="SubmitBookInfoMessage">
<part name="bookInfo" type="xsd:bookInfo"/>
</message>
B. <message name="SubmitBookInfoMessage">
<part name="bookInfo" type="book:bookInfo"/>
</message>
C. <message name="SubmitBookInfoMessage">
<part name="bookInfo" element="xsd:bookInfo"/>
</message>
D. <message name="SubmitBookInfoMessage">
<part name="bookInfo" element="book:bookInfo"/>
</message>
Answer : D
Question: 210
Given:
<complexType name="Book">
<sequence>
<element name="authors" type="xsd:string" maxOccurs="10"/>
<element name="preface" type="xsd:string"/>
<element name="price" type="xsd:float"/>
</sequence>
</complexType>
A developer is using a JAX-RPC implementation to generate an endpoint interface from a WSDL
document. The Book complex type is referenced by the WSDL part of an input message.
Which two Java types can represent the complex type as a parameter in the endpoint interface?
(Choose two.)
A. String
B. SOAPElement
C. StringBuffer
D. a Java class named Book
Answer: B, D
Page 54 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 211
Given:
<xsd:schema targetNamespace="http://www.sun.com/books">
<xsd:element name="bookInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
This WSDL fragment defines the XML document sent in a one-way document-exchange style
Web service.
Which is a possible JAX-RPC service endpoint interface for this Web service?
A. public interface UpDateBookInfo extends Remote {
public void update(BookInfo bookInfo)
throws RemoteException;
}
B. public interface UpDateBookInfo extends Remote {
public String update(BookInfo bookInfo)
throws RemoteException;
}
C. public interface UpDateBookInfo extends Remote {
public BookInfo update(BookInfo bookInfo)
throws RemoteException;
}
D. public interface UpDateBookInfo extends Remote {
public void update(String author,String title)
throws RemoteException;
}
Answer : A
Question: 212
Given:
<message name="FindBookRequest">
<part name="author" type="xsd:string"/>
<part name="title" type="xsd:string"/>
<part name="isbn" type="xsd:string"/>
</message>
<message name="FindBookResponse">
<part name="book" type="tns:Book"/>
<part name="author" type="xsd:string"/>
<part name="isbn" type="xsd:string"/>
<part name="publisher"type="tns:Publisher"/>
</message>
...
<operation name="FindBook"
parameterOrder="author title isbn publisher">
According to the JAX-RPC 1.1 specification, which three parts result in a Holder in a
JAX-RPC-generated method signature? (Choose three.)
Page 55 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
A. isbn
B. book
C. title
D. author
E. publisher
Answer: A, D, E
Question: 213
Which is a valid portType element for a WSDL file defining a request-response Web service?
A. <portType name="Payroll">
<operation name="fileReport">
<message name="fileReport" mode="request-response"/>
</operation>
</portType>
B. <portType name="Payroll">
<operation name="fileReport">
<document name="fileReport" mode="request-response"/>
</operation>
</portType>
C. <portType name="Payroll">
<operation name="fileReport">
<input message="fileReportRequest"/>
<output message="fileReportResponse"/>
</operation>
</portType>
D. <portType name="Payroll">
<operation name="fileReport">
<input document="fileReportRequest"/>
<output document="fileReportResponse"/>
</operation>
</portType>
Answer : C
Question: 214
Which Java type can be used to represent arbitrary XML data in a JAX-RPC service endpoint
interface?
A. org.w3c.dom.Document
B. javax.xml.soap.SOAPPart
C. javax.xml.soap.SOAPElement
D. javax.xml.soap.SOAPException
Answer : C
Question: 215
Given the type declaration in a WSDL description for a Web service:
<element name="PurchaseOrder">
<complexType>
<sequence>
<any maxOccurs="1"/>
</sequence>
Page 56 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
</complexType>
</element>
The Java code generated by a JAX-RPC service endpoint interface consists of a PurchaseOrder
JavaBean.
Which property should the PurchaseOrder JavaBean contain?
A. _any of type java.lang.String
B. PurchaseOrder of type java.lang.Object
C. complexType of type java.lang.Object[]
D. _any of type javax.xml.soap.SOAPElement
Answer : D
Question: 216
A document-style service defines a document passed to the Web service using xsd:anyType in
the WSDL file that describes the service.
How should the document be parsed?
A. use java.util.regex
B. use java.util.StringTokenizer
C. use javax.xml.soap.SOAPHeader
D. use javax.xml.soap.SOAPElement
Answer : D
Question: 217
A developer implements a logging system using a SOAP handler created using the JAX-RPC and
SAAJ APIs.
Which elements of the HTTP messages exchanged in a J2EE Web service interaction can be
accessed using these APIs?
A. the SOAP header elements
B. the SOAP header and HTTP header elements
C. the entire SOAP message and any attachments it contains
D. all of the SOAP message, including attachments, and all of the HTTP elements
Answer : C
Question: 218
Given:
1. public boolean handleRequest(MessageContext context){
2. try{
3. SOAPMessageContext soapCntxt = (SOAPMessageContext)context;
4. SOAPMessage message = soapCntxt.getMessage();
5. message.writeTo(logStream);
6. }catch(javax.xml.soap.SOAPException se){
7. throw new javax.xml.rpc.JAXRPCException(se);
8. }
9. }
The handleRequest method (lines 1-9) is implemented by a JAX-RPC handler.
Given that the logStream is a reference to some type of java.io.OutputStream, which two are
true? (Choose two.)
A. If the handler is associated with a JAX-RPC generated stub, it will write outgoing SOAP
messages to the logStream object.
Page 57 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
B. If the handler is associated with a JAX-RPC generated stub, it will write incoming SOAP
messages to the logStream object.
C. If the handler is associated with a JAX-RPC service endpoint, it will write outgoing SOAP
messages to the logStream object.
D. If the handler is associated with a JAX-RPC service endpoint, it will write incoming SOAP
messages to the logStream object.
Answer: A, D
Question: 219
Given:
1. public boolean handleRequest(MessageContext context){
2. try{
3. SOAPMessageContext soapCntxt = (SOAPMessageContext)context;
4. SOAPMessage message = soapCntxt.getMessage();
5. message.writeTo(logStream);
6. }catch(javax.xml.soap.SOAPException se){
7. throw new javax.xml.rpc.JAXRPCException(se);
8. }
9. }
The handleRequest method (lines 1-9) is implemented by a JAX-RPC handler used for logging.
Given that the method encounters an error and throws a JAXRPCException, which is true?
If the method is implemented by a client-side handler, it will cause a SOAP fault to be generated.
If the method is implemented by a server-side handler, it will cause a SOAP fault to be generated.
If the method is implemented by a client-side handler, the message will continue to be processed
by the handler chain.
If the method is implemented by a server-side handler, the message will continue to be
processed by the handler chain.
Answer : B
Question: 220
Given:
<message name="InvalidItemID">
<part name="ItemID" type="xsd:string"/>
</message>
<portType name="BidAmount">
<operation name="getHighBid">
<input message="sws:getHighBidRequest"/>
<output message="sws:getHighBidResponse"/>
<fault name="InvalidItemID" message="sws:InvalidItemID"/>
</operation>
</portType>
Which endpoint method declaration is generated by this service?
A. public float getHighBid(String itemID);
B. public float getHighBid(String itemID)
throws InvalidItemID;
C. public float getHighBid(String itemID)
throws RemoteException;
D. public float getHighBid(String itemID)
throws RemoteException, InvalidItemID;
Answer : D
Page 58 of 59
© TestKing
Exam Name:
Exam Type
Doc. Type:
Sun Certified Developer for Java Web Services
Sun
Exam Code:
Q & A with Explanations
Total Questions:
310-220
224
Question: 221
A JAX-RPC client is using a stub to connect to a service. The stub implementation supports only
the standard properties supported in the JAX-RPC Stub interface. The client must set the
endpoint address property on the stub.
Given:
stub._setProperty("HTTPLOCATION","http://localhost:8080/services/mySvc");
What is the result?
A.
B.
C.
D.
The application throws an application-specific exception.
The application throws a java.rmi.RemoteException.
The application throws a javax.xml.rpc.JAXRPCException.
The value "http://localhost:8080/services/mySvc" is assigned to the "HTTPLOCATION"
property.
Answer : C
Question: 222
A client sends a required SOAP header in a SOAP message. The server-side process
determines that information in the header is invalid and generates a SOAP fault.
What is the appropriate fault code for this type of SOAP fault?
A. Client
B. Server
C. MustUnderstand
D. VersionMismatch
Answer : A
Question: 223
Which describes the handling of application exceptions thrown by a JAX-RPC service endpoint?
A. Application exceptions can be mapped to faults in WSDL.
B. Application exceptions are NOT handled by JAX-RPC clients.
C. Application exceptions are always propagated to JAX-RPC clients as RemoteExceptions.
D. Application exceptions are always propagated to JAX-RPC clients as SOAPFaultExceptions.
Answer : A
Question: 224
Which two cause a SOAP fault with fault code VersionMismatch in a SOAP document? (Choose
two.)
A. a root element other than Envelope
B. a namespace mismatch in a custom type schema
C. a namespace mismatch with the SOAP Header element
D. a type mismatch in a parameter mismatch in an RPC style service
Answer: A, C
End of Document
Page 59 of 59
© TestKing
© Copyright 2026 Paperzz