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 - Java EE Tutorial
From the course: Java EE 7: Web Services
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Understand SOAP services1m 29s
-
(Locked)
Create a JAX-WS endpoint4m 55s
-
(Locked)
Implement SOAP clients in Java4m 8s
-
(Locked)
Retrieve data via an endpoint3m 25s
-
(Locked)
Create data via an endpoint2m 24s
-
(Locked)
Update data via an endpoint2m 6s
-
(Locked)
Delete data via an endpoint2m
-
(Locked)
Map to entities with JAXB3m 50s
-
(Locked)
-
-
-