[amp_mcq option1=”javax.jws.webservice” option2=”javax.jws.webserviceprovider” option3=”all of the mentioned” option4=”none of the mentioned” correct=”option1″]
The correct answer is: A. javax.jws.webservice
The javax.jws.webservice annotation is used to create a web service in Java. It is a standard annotation that is supported by all Java EE 5 (or better) containers.
The javax.jws.webserviceprovider annotation is used to create a web service provider in Java. It is a standard annotation that is supported by all Java EE 5 (or better) containers.
However, the javax.jws.webserviceprovider annotation is not required if you are deploying into a Java EE 5 (or better) container. You can simply create a bean that is annotated with the javax.jws.webservice annotation and the container will automatically create a web service provider for you.
The following is an example of a bean that is annotated with the javax.jws.webservice annotation:
“`
@WebService
public class MyWebService {
@WebMethod
public String sayHello() {
return "Hello, world!";
}
}
“`
This bean will be automatically deployed as a web service when it is deployed into a Java EE 5 (or better) container.