You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ed Wei (JIRA)" <ji...@apache.org> on 2009/06/24 18:51:07 UTC

[jira] Created: (CXF-2312) wsdl2java replaces @XmlSeeAlso annotation on the base class if the base class already exists.

wsdl2java replaces @XmlSeeAlso annotation on the base class if the base class already exists.
---------------------------------------------------------------------------------------------

                 Key: CXF-2312
                 URL: https://issues.apache.org/jira/browse/CXF-2312
             Project: CXF
          Issue Type: Bug
          Components: Tooling
    Affects Versions: 2.1.5
         Environment: Windows XP
            Reporter: Ed Wei


when using wsdl2java to generate java classes from wsdl files, if the wsdl file contains type definitions of an already generated class, the @XmlSeeAlso annotaion of the class gets replaced instead of appended. 

for example, suppose B extends A. and class A already exists in the target directory.  A have the following code:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "A")
@XmlSeeAlso({B.class})
public class A{
}

if wsdl2java is run on a wsdl file that defines C extends A, the resulting source code for class A SHOULD be:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "A")
@XmlSeeAlso({B.class, C.class})
public class A{
}

it should NOT be:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "A")
@XmlSeeAlso({C.class})
public class A{
}

wsdl2java should not remove annotations, but should append instead. this is crutial for situations where we share objects between 2 different web services, where web service 1 defines class A and B, and web service 2 defines Class A and C.  in this situation, when wsdl2java is run first on web service 1 and then on web service 2, the resulting class A should have @xmlseealso specified on class A for both class B and C.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2312) wsdl2java replaces @XmlSeeAlso annotation on the base class if the base class already exists.

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2312.
------------------------------

       Resolution: Won't Fix
    Fix Version/s: Invalid


I'm going to mark this as "Resolved - Won't Fix" as there is nothing we can do about it.   This is in the JAXB xjc stuff and is exactly how JAXB works. 

The workaround that they would suggest is to use the xjc maven plugin (or the cxf-common-xsd plugin) to generate ALL the types in one shot using a schema that imports everything so that the XmlSeeAlso annotations contain everything.   Then, when running the wsdl2java stuff, use a binding file that tells it to "skip" generating types for those specific namespaces/schemas.   Thus, they wouldn't get overwritten.



> wsdl2java replaces @XmlSeeAlso annotation on the base class if the base class already exists.
> ---------------------------------------------------------------------------------------------
>
>                 Key: CXF-2312
>                 URL: https://issues.apache.org/jira/browse/CXF-2312
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.5
>         Environment: Windows XP
>            Reporter: Ed Wei
>             Fix For: Invalid
>
>
> when using wsdl2java to generate java classes from wsdl files, if the wsdl file contains type definitions of an already generated class, the @XmlSeeAlso annotaion of the class gets replaced instead of appended. 
> for example, suppose B extends A. and class A already exists in the target directory.  A have the following code:
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "A")
> @XmlSeeAlso({B.class})
> public class A{
> }
> if wsdl2java is run on a wsdl file that defines C extends A, the resulting source code for class A SHOULD be:
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "A")
> @XmlSeeAlso({B.class, C.class})
> public class A{
> }
> it should NOT be:
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "A")
> @XmlSeeAlso({C.class})
> public class A{
> }
> wsdl2java should not remove annotations, but should append instead. this is crutial for situations where we share objects between 2 different web services, where web service 1 defines class A and B, and web service 2 defines Class A and C.  in this situation, when wsdl2java is run first on web service 1 and then on web service 2, the resulting class A should have @xmlseealso specified on class A for both class B and C.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.