1Z0-897 Exam - Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam

certleader.com

Q1. Given the resource class: 

Choose the fragment that a client could use to request "/res/value" using its JSON representation (Choose one): 

A. WebResource resource = client.resource("/res/value"); 

Value val = 

resource.accept("application/json").get(Value.class); 

B. WebResource resource = client.resource("/res/value"); 

Value val = 

resource.type("application/json").get(Value.class); 

C. WebResource resource = client.resource("/res"); 

Value val = 

resource.accept("value").type("application/json").get(Value.class); 

D. WebResource resource = client.resource("/res/value"); 

Value val = resource.get(Value.class); 

Answer:

Q2. In the following situation, Client C sends a SOAP request to Service S and the response is to be processed by a third party response processor R. Which of the following SOAP headers in the request message convey the intention? Assume the endpoint reference of Service S is 

A. <s11:Header> 

<wsa:Action>http://example.com/action/process</wsa:Action> 

<wsa:ReplyTo> 

<wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address> 

<wsa:ReplyTo> 

</s11:Header> 

B. <s11:Header> 

<wsa:Action>http://example.com/action/process</wsa:Action> 

<wsa:ReplyTo> 

<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address> 

<wsa:ReplyTo> 

</s11:Header> 

C. <s11:Header> 

<wsa:Action>http://example.com/action/process</wsa:Action> 

<wsa:ReplyTo> 

<wsa:Address>http://example.com/responseprocessor</wsa:Address> 

<wsa:ReplyTo> 

</s11:Header> 

D. <s11:Header> 

<wsa:Action>http://example.com/action/process</wsa:Action> 

<wsa:ReplyTo> 

<wsa:Address>http://example.com/service</wsa:Address> 

<wsa:ReplyTo> 

</s11:Header> 

Answer:

Q3. A developer wants to use WebServiceContext in the web service endpoint. Which of the following is the correct way to get WebServiceContext object ? (Choose one) 

A. @WebService 

public class MyService { 

@WebServiceContext 

WebServiceContext ctxt; 

public String echo(String str) { 

... 

B. @WebService 

public class MyService { 

WebServiceContext ctxt; 

public String echo(String str) { ctxt = jndi.lookup("java:com/env/WebServiceContext"); } 

C. @WebService 

public class MyService { 

@Inject 

WebServiceContext ctxt; 

public String echo(String str) { 

... 

D. @WebService 

public class MyService { 

@Resource 

WebServiceContext ctxt; 

public String echo(String str) { 

... 

Answer:

Q4. A student developer has created a new library of math functions to share with friends in a linear algebra class. The developer is having difficulty getting people to come over to the dorm to see the new code library, so he decides to deploy it as a Web service so that everyone can enjoy the features via the Internet. One of the functions has this WSDL definition: 

<portType name="MyMathLib"><operation name="incCtr"><input message="tns:incCtr"/></operation></portType> 

Which two statements are true about this Web service? (Choose two.) 

A. This is an asynchronous receive. 

B. This indicates a one-way message exchange pattern 

C. The client must use SOAPFaultException to display any errors. 

D. It must send a SOAP fault back to the sender. 

E. It must NOT send a SOAP fault back to the sender. 

Answer: BE 

Q5. Which of the following can be used on the SEI's method parameter so that the corresponding generated schema type is wsiap:swaref ? (Choose one) 

A. @XMLSchemaType 

B. @SwaRef 

C. @XmlMimeType 

D. @XMLAttachmentRef 

Answer:

Q6. Assume the code is free of gross flaws and syntax errors. Which two statements are true? (Choose two.) 

A. Line 8 specifies that addInventory accepts either a valid total or quantity. 

B. Line 1 indicates the portType is LogInventory. 

C. Line 3 shows the method is mapped to the WSDL operation called "checkProduct". 

D. Line 4 means that a method is not expected to return a value unless requested. 

E. Line 7 implies WSDL operation and method name are the same. 

Answer: BE 

Q7. Given the resource class fragment: Choose the code fragment below that would secure access only to the Resource update() method (Choose one): 

A. <security-constraint> 

<web-resource-collection> 

<url-pattern>/rest</url-pattern> 

<http-method>GET</http-method> 

<http-method>POST</http-method> 

</web-resource-collection> 

B. <security-constraint> 

<web-resource-collection> 

<url-pattern>/rest</url-pattern> 

<http-method>POST</http-method> 

</web-resource-collection> 

C. <security-constraint> 

<web-resource-collection> 

<url-pattern>/rest/id</url-pattern> 

<http-method>POST</http-method> 

<http-method>GET</http-method> 

</web-resource-collection> 

D. <security-constraint>D.<security-constraint> 

<web-resource-collection> 

<url-pattern>/id</url-pattern> 

<http-method>POST</http-method> 

</web-resource-collection> 

Answer:

Q8. When working directly with SOAP, which two statements are true about the encoding of compound values? (Choose two.) 

A. Compound values cannot be encoded. 

B. A compound value may NOT contain other compound values. 

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: CD 

Q9. A developer is creating a web service endpoint using a stateless session EJB for the business logic of an application. Choose two methods to select role based access control for the business logic ? (Choose two) 

A. Using method-permission element in ejb-jar.xml 

B. Using .htaccess file in the application's ear 

C. Using <security-role> element in web.xml 

D. By specifying security annotations like @RolesAllowed in the EJB class 

Answer: AD 

Q10. 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 two approaches are appropriate to use in this situation? (Choose two.) 

A. A synchronous, document-style approach. 

B. A synchronous, procedure-style approach. 

C. An asynchronous, document-style approach. 

D. An asynchronous, procedure-style approach. 

E. HTTP and HTTPS. 

F. SMTP or other asynchronous protocol. 

Answer: CF