Hi Jonathan,
How about this way ?
Get the param names from jws and put a hidden constant pool ( class
variable ) holding the names into the jws and makes APT compile it.
After the compilation, replaces the modified code with the original one.
Here's the example.
-------- original jws --------------------------
@WebService
public class MyWS {
@WebMethod
public void WhatIsYourAge(int age){...}
@WebMethod
public void Add(int myAge, int yourAge){...}
}
-------- modified jws --------------------------
@WebService
public class MyWS {
public static Map<String,String> _HIDDEN_CONSTANT_POOL_
= new HashMap<String,String>();
static{
_HIDDEN_CONSTANT_POOL_.add("WhatIsYourAge0","age");
_HIDDEN_CONSTANT_POOL_.add("Add0","myAge,yourAge");
}
@WebMethod
public void WhatIsYourAge(int age){...}
}
We have to be careful that the name of the class variable doesn't be
doubled in the original code, but this way is really simple and easy.
( Of course, we must think how to match the name of the key in the pool
and a method in the jws. )
Thanks in advance.
Wolfgang