O'Reilly logo

Apache Axis2 Web Services Second Edition by Afkham Azeez, Deepal Jayasinghe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JSR 222 (JAXB) annotations

In this section, we will be looking at some of the useful annotations introduced in the JSR 222 (JAXB) specification. JAXB is a specification which defines how JavaBeans can be data bound to XML. We will be looking into the following annotations:

  • javax.xml.bind.annotation.XmlRootElement
  • javax.xml.bind.annotation.XmlAccessorType
  • javax.xml.bind.annotation.XmlElement

javax.xml.bind.annotation.XmlRootElement

This annotation is used for mapping a top-level class to a global element in the WSDL's XML schema. This annotation is defined as follows:

@Retention(RUNTIME)
@Target({TYPE})
public @interface XmlRootElement {
String namespace() default "##default";
String name() default "##default";
}

This annotation contains two properties— ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required