From the course: Java EE 7: Web Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Map to entities with JAXB

Map to entities with JAXB - Java EE Tutorial

From the course: Java EE 7: Web Services

Start my 1-month free trial

Map to entities with JAXB

- [Instructor] JAX-B stands for the Java API for XML binding and allows for data mapping between Java and XML. The mapping of Java programming language types, to and from XML definitions, is delegated to JAX-B. It follows the default Java-to-XML and XML-to-Java mapping for each method parameter and return type. The usual JAX-B annotations can be used to customize the mapping to the generated schema. JAX-B provides two main features, the ability to marshal Java objects into XML and the inverse, the ability to unmarshal XML back into Java objects. I've opened the project in IntelliJ, and navigated to the Application.java file. So let's look at this class. On line 8, notice I'm using the @XmlRootElement, which allows the application class to be converted to XML and vice versa. Now, let's navigate to the application service. And let's scroll down. Let's look at line 19. This is the line that's most important. This is where I'm setting the SOAPBinding style. Now, there are communication…

Contents