[ 
https://issues.apache.org/jira/browse/CXF-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528450
 ] 

Daniel Kulp commented on CXF-1032:
----------------------------------


I think I'd have to see a testcase for this.   The @WebMethod stuff is for the 
JAX-WS SEI interface which should have no bearing on JAXB types.    To ignore 
stuff in JAXB, it would be an @XmlTransient (which admittedly being ignored 
here).



> @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.

Reply via email to