@WebMethod (exclude = true) are not being excluded
---------------------------------------------------
Key: CXF-1032
URL: https://issues.apache.org/jira/browse/CXF-1032
Project: CXF
Issue Type: Bug
Components: JAXB Databinding
Affects Versions: 2.0.1
Environment: Mac OS/X JDK 1.5
Reporter: Garry Watkins
Methods with @WebMethod(exclude = true) are still being included when bringing
in classes that will have WSDL generated. I have tracked down the issue to the
org.apache.cxf.jaxb.JAXBContextInitializer class.
I have included the replacement method here
private void walkReferences(Class<?> cls) {
if (cls.getName().startsWith("java.")
|| cls.getName().startsWith("javax.")) {
return;
}
//walk the public fields/methods to try and find all the classes. JAXB
will only load the
//EXACT classes in the fields/methods if they are in a different
package. Thus,
//subclasses won't be found and the xsi:type stuff won't work at all.
//We'll grab the public field/method types and then add the
ObjectFactory stuff
//as well as look for jaxb.index files in those packages.
Field fields[] = cls.getFields();
for (Field f : fields) {
addType(f.getGenericType());
}
Method methods[] = cls.getMethods();
for (Method m : methods) {
// START The following lines were added by GW
WebMethod wm = m.getAnnotation(WebMethod.class);
if (null != wm){
if (wm.exclude()){
System.out.println("Skipping method " +
m.toString());
continue;
}
}
//END GW
addType(m.getGenericReturnType());
for (Type t : m.getGenericParameterTypes()) {
addType(t);
}
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.