You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Richard Opalka (JIRA)" <ji...@apache.org> on 2012/10/24 18:52:12 UTC

[jira] [Created] (CXF-4600) Exception inheritance not working over SOAP protocol

Richard Opalka created CXF-4600:
-----------------------------------

             Summary: Exception inheritance not working over SOAP protocol
                 Key: CXF-4600
                 URL: https://issues.apache.org/jira/browse/CXF-4600
             Project: CXF
          Issue Type: Bug
          Components: JAXB Databinding
    Affects Versions: 2.7.0, 2.6.3, 2.5.6, 2.4.10
            Reporter: Richard Opalka
             Fix For: 2.4.11, 2.5.7, 2.6.4, 2.7.1


If method parameter or return type are subject to object inheritance,
passing such complex classes works without any problems over SOAP.
But when exception is subject to object inheritance, the inheritance
is unfunctional over SOAP protocol.

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

[jira] [Resolved] (CXF-4600) Exception inheritance not working over SOAP protocol

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

Richard Opalka resolved CXF-4600.
---------------------------------

       Resolution: Won't Fix
    Fix Version/s:     (was: 2.4.11)
                       (was: 2.5.7)
                       (was: 2.6.4)
                       (was: 2.7.1)

Resolving as won't fix, see: http://cxf.547215.n5.nabble.com/Exceptions-inheritance-JAXB-de-serialization-issue-td5719499.html
                
> Exception inheritance not working over SOAP protocol
> ----------------------------------------------------
>
>                 Key: CXF-4600
>                 URL: https://issues.apache.org/jira/browse/CXF-4600
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.4.10, 2.5.6, 2.6.3, 2.7.0
>            Reporter: Richard Opalka
>         Attachments: CXF-4600-reproducer.zip
>
>
> If method parameter or return type are subject to object inheritance,
> passing such complex classes works without any problems over SOAP.
> But when exception is subject to object inheritance, the inheritance
> is unfunctional over SOAP protocol.

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

[jira] [Updated] (CXF-4600) Exception inheritance not working over SOAP protocol

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

Richard Opalka updated CXF-4600:
--------------------------------

    Attachment: CXF-4600-reproducer.zip

My CXF architecture knowledge is insufficient
to provide patch for this issue. Thus providing test case - see attached zip.
                
> Exception inheritance not working over SOAP protocol
> ----------------------------------------------------
>
>                 Key: CXF-4600
>                 URL: https://issues.apache.org/jira/browse/CXF-4600
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.4.10, 2.5.6, 2.6.3, 2.7.0
>            Reporter: Richard Opalka
>             Fix For: 2.4.11, 2.5.7, 2.6.4, 2.7.1
>
>         Attachments: CXF-4600-reproducer.zip
>
>
> If method parameter or return type are subject to object inheritance,
> passing such complex classes works without any problems over SOAP.
> But when exception is subject to object inheritance, the inheritance
> is unfunctional over SOAP protocol.

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

[jira] [Commented] (CXF-4600) Exception inheritance not working over SOAP protocol

Posted by "Richard Opalka (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483909#comment-13483909 ] 

Richard Opalka commented on CXF-4600:
-------------------------------------

Hi Aki,

   I will not remove @XmlTransient annotation on Exception class, because I want it there (this is my usecase).
See javadoc of @XmlTransient annotation:

http://docs.oracle.com/javaee/6/api/javax/xml/bind/annotation/XmlTransient.html

Also notice, that this scenario works for method parameters and return types without problems, but not for exceptions
(see provided reproducer)


                
> Exception inheritance not working over SOAP protocol
> ----------------------------------------------------
>
>                 Key: CXF-4600
>                 URL: https://issues.apache.org/jira/browse/CXF-4600
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.4.10, 2.5.6, 2.6.3, 2.7.0
>            Reporter: Richard Opalka
>             Fix For: 2.4.11, 2.5.7, 2.6.4, 2.7.1
>
>         Attachments: CXF-4600-reproducer.zip
>
>
> If method parameter or return type are subject to object inheritance,
> passing such complex classes works without any problems over SOAP.
> But when exception is subject to object inheritance, the inheritance
> is unfunctional over SOAP protocol.

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

[jira] [Commented] (CXF-4600) Exception inheritance not working over SOAP protocol

Posted by "Freeman Fang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483858#comment-13483858 ] 

Freeman Fang commented on CXF-4600:
-----------------------------------

Aki's suggestion should work, but the root problem is that CXF currently not exactly follow the JAXWS 3.7 chapter when use java first way for exception class marshal/unmarshall, mainly not map each getter in the exception and its superclasses
There's already related discussion[1]&[2] recently, and also a jira ticket[3] for it
[1]http://cxf.547215.n5.nabble.com/Incompatible-fault-type-is-generated-in-the-wsdl-with-RI-command-td5716852.html
[2]http://cxf.547215.n5.nabble.com/Webfault-td5716784.html
[3]https://issues.apache.org/jira/browse/CXF-4594

Freeman


                
> Exception inheritance not working over SOAP protocol
> ----------------------------------------------------
>
>                 Key: CXF-4600
>                 URL: https://issues.apache.org/jira/browse/CXF-4600
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.4.10, 2.5.6, 2.6.3, 2.7.0
>            Reporter: Richard Opalka
>             Fix For: 2.4.11, 2.5.7, 2.6.4, 2.7.1
>
>         Attachments: CXF-4600-reproducer.zip
>
>
> If method parameter or return type are subject to object inheritance,
> passing such complex classes works without any problems over SOAP.
> But when exception is subject to object inheritance, the inheritance
> is unfunctional over SOAP protocol.

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

[jira] [Commented] (CXF-4600) Exception inheritance not working over SOAP protocol

Posted by "Aki Yoshida (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483630#comment-13483630 ] 

Aki Yoshida commented on CXF-4600:
----------------------------------

i think you can transfer the values if you annotate the exception class.
e.g.
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "message",
    "description",
    "code"
})
@XmlRootElement(name = "faultDetail")
public class AbstractException extends Exception {
...

with your original non-annotated class, your serialized fault looks like this:
<soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>exception message</faultstring>
  <detail>
    <ns1:AbstractException xmlns:ns1="http://issue.cxf/"/>
  </detail>
</soap:Fault>

so there are no attribute values transferred.

with the above annotated exception, your serialized fault looks like this:

<soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>exception message</faultstring>
  <detail>
    <ns1:AbstractException xmlns:ns1="http://issue.cxf/">
      <message xmlns:ns2="http://issue.cxf/">exception message</message>
      <description xmlns:ns2="http://issue.cxf/">exception description</description>
      <code xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://issue.cxf/" xsi:type="xs:int">500</code>
    </ns1:AbstractException>
  </detail>
</soap:Fault>

and the attribute values are transferred to the client.

does this solve your problem?

regards, aki
                
> Exception inheritance not working over SOAP protocol
> ----------------------------------------------------
>
>                 Key: CXF-4600
>                 URL: https://issues.apache.org/jira/browse/CXF-4600
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.4.10, 2.5.6, 2.6.3, 2.7.0
>            Reporter: Richard Opalka
>             Fix For: 2.4.11, 2.5.7, 2.6.4, 2.7.1
>
>         Attachments: CXF-4600-reproducer.zip
>
>
> If method parameter or return type are subject to object inheritance,
> passing such complex classes works without any problems over SOAP.
> But when exception is subject to object inheritance, the inheritance
> is unfunctional over SOAP protocol.

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

[jira] [Comment Edited] (CXF-4600) Exception inheritance not working over SOAP protocol

Posted by "Aki Yoshida (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483630#comment-13483630 ] 

Aki Yoshida edited comment on CXF-4600 at 10/24/12 10:43 PM:
-------------------------------------------------------------

i think you can transfer the values if you remove the XmlTransient annotation and add the corresponding property setters so that those properties are visible from both classes.

with this change, your serialized faults will look like:
<soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>exception message</faultstring>
  <detail>
    <ns1:CustomException xmlns:ns1="http://issue.cxf/">
      <message xmlns:ns2="http://issue.cxf/">exception message</message>
      <description xmlns:ns2="http://issue.cxf/">exception description</description>
      <code xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://issue.cxf/" xsi:type="xs:int">500</code>
    </ns1:CustomException>
  </detail>
</soap:Fault>

<soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>exception message</faultstring>
  <detail>
    <ns1:AbstractException xmlns:ns1="http://issue.cxf/">
      <message xmlns:ns2="http://issue.cxf/">exception message</message>
      <description xmlns:ns2="http://issue.cxf/">exception description</description>
      <code xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://issue.cxf/" xsi:type="xs:int">500</code>
    </ns1:AbstractException>
  </detail>
</soap:Fault>

and the properties can be transferred to the client.

does this solve your problem?

regards, aki
                
      was (Author: ay):
    i think you can transfer the values if you annotate the exception class.
e.g.
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "message",
    "description",
    "code"
})
@XmlRootElement(name = "faultDetail")
public class AbstractException extends Exception {
...

with your original non-annotated class, your serialized fault looks like this:
<soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>exception message</faultstring>
  <detail>
    <ns1:AbstractException xmlns:ns1="http://issue.cxf/"/>
  </detail>
</soap:Fault>

so there are no attribute values transferred.

with the above annotated exception, your serialized fault looks like this:

<soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>exception message</faultstring>
  <detail>
    <ns1:AbstractException xmlns:ns1="http://issue.cxf/">
      <message xmlns:ns2="http://issue.cxf/">exception message</message>
      <description xmlns:ns2="http://issue.cxf/">exception description</description>
      <code xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://issue.cxf/" xsi:type="xs:int">500</code>
    </ns1:AbstractException>
  </detail>
</soap:Fault>

and the attribute values are transferred to the client.

does this solve your problem?

regards, aki
                  
> Exception inheritance not working over SOAP protocol
> ----------------------------------------------------
>
>                 Key: CXF-4600
>                 URL: https://issues.apache.org/jira/browse/CXF-4600
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.4.10, 2.5.6, 2.6.3, 2.7.0
>            Reporter: Richard Opalka
>             Fix For: 2.4.11, 2.5.7, 2.6.4, 2.7.1
>
>         Attachments: CXF-4600-reproducer.zip
>
>
> If method parameter or return type are subject to object inheritance,
> passing such complex classes works without any problems over SOAP.
> But when exception is subject to object inheritance, the inheritance
> is unfunctional over SOAP protocol.

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

[jira] [Commented] (CXF-4600) Exception inheritance not working over SOAP protocol

Posted by "Aki Yoshida (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483978#comment-13483978 ] 

Aki Yoshida commented on CXF-4600:
----------------------------------

Freeman, Richard,
okay.
Thanks for clarifying the background and pointing me to the related issues.
regards, aki

                
> Exception inheritance not working over SOAP protocol
> ----------------------------------------------------
>
>                 Key: CXF-4600
>                 URL: https://issues.apache.org/jira/browse/CXF-4600
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 2.4.10, 2.5.6, 2.6.3, 2.7.0
>            Reporter: Richard Opalka
>             Fix For: 2.4.11, 2.5.7, 2.6.4, 2.7.1
>
>         Attachments: CXF-4600-reproducer.zip
>
>
> If method parameter or return type are subject to object inheritance,
> passing such complex classes works without any problems over SOAP.
> But when exception is subject to object inheritance, the inheritance
> is unfunctional over SOAP protocol.

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