You put @XMLElement (required = true) above the variables in your class that are returned from your service. I just found out about this option about a month ago. So, right here where you declare empName, put the tag and be sure.
To rename your service settings, use @WebParam (name = "") before each input variable to the service.
For example, if you have a get (String name) service method, it will look like get (@WebParam (name = "name") String name)
You are right, now I read your comment again. The services that I support use objects in the input and output file, so I put the XMLElement tag in the class of these objects.
You need to put a tag in a class that declares variables that have been passed or returned to the service. If this is announced in your class of service, this is normal. The main thing is that you put this XMLElement tag above the variable declaration, rather than putting it on a getter or setter.
This manual contains examples of use. JAXB Tutorial
Logan
source share