Free Oracle 1Z0-897 Exam Practice Questions & Explanations
Prepared & Reviewed by the ValidExamDumps Editorial Team
At ValidExamDumps, we consistently monitor updates to the Oracle 1Z0-897 exam questions by Oracle. Whenever our team identifies changes in the exam questions, objectives, focus areas or requirements, We immediately update our exam questions for both PDF and online practice exams. This commitment ensures our customers always have access to the most current and accurate questions. By preparing with these up to date and 100% exam domain coverage questions, our customers can successfully pass the Oracle Java EE 6 Web Services Developer Certified Expert exam on their first attempt without needing additional materials or study guides.
Other certification materials providers often include outdated or removed questions by Oracle in their 1Z0-897 exam. These outdated questions lead to customers failing their Oracle Java EE 6 Web Services Developer Certified Expert exam. In contrast, we ensure our questions bank includes only precise and up-to-date questions. Our main priority is your success in the Oracle 1Z0-897 exam, not profiting from selling obsolete exam questions in PDF or Online Practice Test.
A JAX-WS SOAP endpoint deployed in a servlet container needs access to the HTTP request headers of the incoming SOAP request, and must also know the authenticated user's principal for auditing.
What is the correct standard way for the endpoint implementation class to obtain this information?
The portable mechanism is resource injection of javax.xml.ws.WebServiceContext via @Resource. From it, getMessageContext() gives access to properties such as MessageContext.SERVLET_REQUEST and the HTTP request headers, and getUserPrincipal() returns the authenticated principal. B is not portable—HttpServletRequest is obtained through the message context, not injected into the endpoint. C confuses handlers (separate classes configured in a handler chain) with the endpoint. D is not an existing API.
A developer packages a JAX-RS application in a WAR for a Java EE 6 servlet container. The WAR contains a class annotated with @ApplicationPath("/api") that extends javax.ws.rs.core.Application, plus several root resource classes annotated with @Path. The web.xml contains no servlet declaration for JAX-RS at all.
Statement: The application will still be deployed and the resources reachable under /contextRoot/api.
True. In a Java EE 6 (Servlet 3.0) container, JAX-RS applications are discovered automatically. If an Application subclass annotated with @ApplicationPath is present, the container adds the JAX-RS servlet dynamically and maps it to that path, so no web.xml servlet declaration is required. An explicit web.xml servlet mapping is only needed to override the annotation or in pre-Servlet 3.0 containers.
An architect wants to expose an existing stateless session bean as a SOAP web service so it can benefit from container-managed transactions and EJB security, and be packaged in an EJB JAR rather than a WAR.
Which statements about this approach are correct? (Choose two.)
An EJB-based JAX-WS endpoint is a stateless session bean (or singleton in EE 6) annotated with @WebService/@WebServiceProvider; it can be packaged directly in an EJB JAR. Because it is an EJB, standard EJB security annotations such as @RolesAllowed and container-managed transactions apply.
B is incorrect as written only in that it excludes nothing relevant here—but the definitive restriction tested is that stateful beans are never allowed, making C wrong; B is also inaccurate because the requirement in the specification is the endpoint be a stateless or singleton bean, yet the answer set asks for the two clearly correct statements about annotation and security. D is wrong: the endpoint interface is a separate SEI annotated @WebService, not the local business interface.
A team exposes a JAX-RS resource in a WAR. They want the resource method to handle HTTP GET on /reports/2024/summary and also on /reports/2025/summary, capturing the year as an integer path parameter, and to return the entity as JSON only when the client asks for it.
Which method declaration achieves this?
JAX-RS URI templates use curly braces, and @PathParam binds the template variable; JAX-RS converts the string to int automatically. @Produces declares the media type the method can return and participates in content negotiation with the client's Accept header. B is wrong because the year is in the path, not a query parameter, and @Consumes describes the request body (a GET has none). C uses invalid template syntax. D uses the wrong HTTP method.
A developer is building a JAX-WS SOAP endpoint that will be packaged in a WAR and deployed to a servlet container (Java EE 6 Web Profile plus JAX-WS runtime). The class is:
@WebService
public class OrderService {
public String submit(String order) { return "OK"; }
private void log(String msg) { }
protected int count() { return 0; }
public static String version() { return "1.0"; }
}No @WebMethod annotations are used. Which methods are exposed as web service operations?
When a class annotated with @WebService has no explicit @WebMethod annotations, all public methods (excluding those inherited from java.lang.Object) are exposed. Static and final methods cannot be web service operations, so version() is excluded. Private and protected methods are never exposed. Therefore only submit becomes an operation.
