Rajeev Rnair wrote:great ! In document / literal / wrapped mode, the wrapper JAXB beans will be generated based on method name. so you will have issues with overloaded methods.
hence you have to use annotations for @RequestWrapper and @ResponseWrapper.
By default the mode is document / literal / wrapped.
If you add annotation
the overloading will work without @ResponseWrapper / @RequestWrapper annotations.
(i got all this info from Mikalai Zaikin's notes. credit goes to him for providing so much internals !
@Rajeev, thank you for your kind words !
@Poornima, please take a look at JAX-WS 2.2 specification, section "3.6.2.1 Document Wrapped" - I copied most important paragraphs related to your case:
...
For the purposes of utilizing the JAXB mapping, each method is converted to two Java bean classes: one for the method input (henceforth called the request bean) and one for the method output (henceforth called the response bean). Application’s programming model doesn’t use these bean classes, so the applications need not package these classes. JAX-WS implementations may generate these classes dynamically as specified in this section.
...
In the absence of customizations, the wrapper request bean class MUST be named the same as the method and the wrapper response bean class MUST be named the same as the method with a “Response” suffix. The first letter of each bean name is capitalized to follow Java class naming conventions.
...
The javax.xml.ws.RequestWrapper and javax.xml.ws.ResponseWrapper annotations MAY be used to customize the name of the generated wrapper bean classes.
...
Generated bean classes must have unique names within a package and MUST NOT clash with other classes in that package. Clashes during generation MUST be reported as an error and require user intervention via name customization to correct. Note that some platforms do not distiguish filenames based on case so comparisons MUST ignore case.
This means that you can not have two methods with same name without specifying customizations. You have to use RequestWrapper and ResponseWrapper annotations on overloaded methods.
NOTE: The default (your code example) combination for JAX-WS 2 is DOCUMENT/LITERAL/WRAPPED
Best regards,
MZ