cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Ma (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CXF-5219) @XmlJavaTypeAdapter ignored for exception members
Date Fri, 23 Aug 2013 09:27:53 GMT

     [ https://issues.apache.org/jira/browse/CXF-5219?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jim Ma resolved CXF-5219.
-------------------------

    Resolution: Fixed

Patch applied.Thanks, Kyle.
                
> @XmlJavaTypeAdapter ignored for exception members
> -------------------------------------------------
>
>                 Key: CXF-5219
>                 URL: https://issues.apache.org/jira/browse/CXF-5219
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.5.11, 2.6.9, 2.7.6
>            Reporter: Kyle Lape
>            Assignee: Jim Ma
>             Fix For: 3.0.0, 2.6.10, 2.7.7
>
>         Attachments: cxf5219.diff
>
>
> Given the interface:
> {code:java}
> @javax.jws.WebService
> public interface WsIntfc {
>     public void test() throws MyException;
> }
> {code}
> And exception class:
> {code:java}
> public class MyException extends Exception {
>   private MyClass1 adapted = null;
>   
>   @XmlJavaTypeAdapter(Cl1ToCl2Adapter.class)
>   public MyClass1 getAdapted() {
>       return this.adapted;
>   }
>   
>   public void setAdapted(MyClass1 adapted) {
>       this.adapted = adapted;
>   }
> }
> {code}
> Along with:
> {code:java}
> public class Cl1ToCl2Adapter extends XmlAdapter<MyClass2, MyClass1> {
>   @Override
>   public MyClass1 unmarshal(MyClass2 v) throws Exception {
>       MyClass1 mc1 = new MyClass1();
>       mc1.setName(v.getFile());
>       return mc1;
>   }
>   @Override
>   public MyClass2 marshal(MyClass1 v) throws Exception {
>       MyClass2 mc2 = new MyClass2();
>       mc2.setFile(v.getName());
>       return mc2;
>   }
> }
> {code}
> {code:java}
> public class MyClass1 {
>   private String name = null;
>   
>   public String getName() {
>     return this.name;
>   }
>   
>   public void setName(String name) {
>     this.name = name;
>   }
>   
> }
> {code}
> {code:java}
> public class MyClass2 {
>   private String file = null;
>   
>   public String getFile() {
>     return this.file;
>   }
>   
>   public void setFile(String file) {
>     this.file = file;
>   }
> }
> {code}
> I get the following schema output:
> {code:xml}
> <xs:complexType name="myClass1">
>   <xs:sequence>
>     <xs:element minOccurs="0" name="name" type="xs:string"/>
>   </xs:sequence>
> </xs:complexType>
> <xs:complexType name="MyException">
>   <xs:sequence/>
> </xs:complexType>
> {code}
> I should expect {{myClass2}} defined in the schema and referenced by {{MyException}}.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message