Java EE 7 Application Developer — Question 18
How can you inject a target web service into an EJB?
Answer options
- A. Define service as an injectable resource by using the <resource-ref> declaration.
- B. Use a HandlerChain.
- C. Use a java.xml.ws.WebServiceRef annotation.
- D. Use a java.xml.ws.WebServiceContext annotation.
Correct answer: A
Explanation
The correct answer is A because defining the service as an injectable resource using the <resource-ref> declaration is the standard approach for EJBs. The other options, while related to web services, do not pertain to the specific method of injecting a web service into an EJB.