Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 58

Which statement is true about Java methods that are exposed as Web Service operations by using JAX-WS API?

    Correct Answer: B

    For a Java method to be exposed as a Web Service operation using the JAX-WS API, the method parameters and return types must be JAXB compatible. JAXB (Java Architecture for XML Binding) is necessary to convert Java objects into XML and vice versa, which is essential for web services communication. This ensures that the data can be properly serialized and deserialized between the web service and its clients.

Discussion
orjavaOption: B

Answer B. the question don t mention if is a session bean so D is not correct. JAX-WS requirements: -Must be public. By default every public method in the class will be part of the webservice. - Must not be static of final - Must have JAXB-compatible parameters and return types. Parameters and return types must not implement the java.rmi.Remote interface. - Business methods (Session Bean) that are exposed to web service client must be annotated with javax.jws.Webmethod

peteVlnOption: D

@WebMethod is optional

devmsalehOption: D

D is correct according to (Requirements of a JAX-WS Endpoint) : https://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXWS3.html