Handling interfaces in RPC-style web services

Recall that the message style for our web service implementation class is Document and the encoding is literal. Let's change the style to RPC. Open CourseManagementService.java and change the style of the SOAP binding from Style.DOCUMENT to Style.RPC:

@WebService 
@SOAPBinding(style=Style.RPC, use=Use.LITERAL) 
public class CourseManagementService {...} 

Restart Tomcat. In the Tomcat console, you might see the following error:

    Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.util.List is an interface, and JAXB can't handle interfaces.
      this problem is related to the following location:
        at java.util.List

This problem is caused by

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.