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 p (JIRA)" <ji...@apache.org> on 2007/10/25 12:22:50 UTC

[jira] Created: (CXF-1136) Custom exception not appearing in SOAP fault response

Custom exception not appearing in SOAP fault response
-----------------------------------------------------

                 Key: CXF-1136
                 URL: https://issues.apache.org/jira/browse/CXF-1136
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.0.2
         Environment: WIndows XP
Java SDK 1.5_0_12
            Reporter: ed p
            Priority: Critical
         Attachments: helloWorld.wsdl, java_first_jaxws.zip

I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:

public interface HelloWorld {
    Response sayHi(Request text) throws CustomException;
}

CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception

The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>custom error</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "Piotr Berłowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537746 ] 

Piotr Berłowski commented on CXF-1136:
--------------------------------------

I would say, that this one is a duplicate for CXF-1131 and has been fixed a few days ago in 2.0.3 and in CVS, by Daniel Kulp. Please review 1131 and mark this one duplicate, if I'm right.

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Updated: (CXF-1136) Custom exception not appearing in SOAP fault response

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

ed p updated CXF-1136:
----------------------

    Attachment: java_first_jaxws.zip

modified sample project

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Updated: (CXF-1136) Custom exception not appearing in SOAP fault response

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

ed p updated CXF-1136:
----------------------

    Attachment: wsit-jaxws-fromjava.zip

sample code using glassfish metro

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, helloworld_glassfishmetro.wsdl, java_first_jaxws.zip, wsit-jaxws-fromjava.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Resolved: (CXF-1136) Custom exception not appearing in SOAP fault response

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

Daniel Kulp resolved CXF-1136.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.3

Used your CustomException.java as a test case.   Passes now with JAXB.

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Assignee: Daniel Kulp
>            Priority: Critical
>             Fix For: 2.0.3
>
>         Attachments: helloWorld.wsdl, helloworld.xsd, helloworld_glassfishmetro.wsdl, java_first_jaxws.zip, wsit-jaxws-fromjava.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "ed p (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538487 ] 

ed p commented on CXF-1136:
---------------------------

I've tested my sample code using Axis 1.4 and GlassFish Metro. Both worked with the response containing the exception in the fault/detail node.

Here's the sample response generated by GlassFish Metro:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:Fault xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
         <faultcode>ns2:Server</faultcode>
         <faultstring>custom error</faultstring>
         <detail>
            <ns2:CustomException xmlns:ns2="http://server.hw.demo/">
               <a>123</a>
               <b>abc</b>
               <message>custom error</message>
            </ns2:CustomException>
            <ns2:exception class="demo.hw.server.CustomException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
               <message>custom error</message>
               <ns2:stackTrace>
                  <ns2:frame class="demo.hw.server.HelloWorldImpl" line="unknown" method="sayHi"/>
                  <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" line="native" method="invoke0"/>

Okay well that's it from me as I need to move on evaluating other WS projects. Thanks for your input Glen.

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Assigned: (CXF-1136) Custom exception not appearing in SOAP fault response

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

Daniel Kulp reassigned CXF-1136:
--------------------------------

    Assignee: Daniel Kulp

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Assignee: Daniel Kulp
>            Priority: Critical
>         Attachments: helloWorld.wsdl, helloworld.xsd, helloworld_glassfishmetro.wsdl, java_first_jaxws.zip, wsit-jaxws-fromjava.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Updated: (CXF-1136) Custom exception not appearing in SOAP fault response

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

ed p updated CXF-1136:
----------------------

    Attachment: helloworld_glassfishmetro.wsdl

wsdl generated by glassfish metro

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, helloworld_glassfishmetro.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537610 ] 

Glen Mazza commented on CXF-1136:
---------------------------------

In comparing Metro and CXF outputs, I think I found the problem.  You appear to be using a nonstandard form of creating an exception that does *not* result in the underlying CustomException exception being stored.  I do not know why CXF provides this form.

In your service class, you call:
    throw new CustomException("custom error");

In other words, the first of these three possible constructors:

    public CustomException (String message) {  super(message);  }

    public CustomException (String message, demo.hw.company.CustomExceptionType customException) {
        super(message); this.customException = customException;  }

    public CustomException (String message, demo.hw.company.CustomExceptionType customException, Throwable cause) {
        super(message, cause);  this.customException = customException;  }

But only the latter two causes the customException to be stored.  

Metro's wsimport, at least JAX-WS 2.1 version, does *not* provide for the top constructor that you were unwittingly using, so you must use either of the bottom two.  I don't know enough about why we provide the first constructor variant--either it's a JAX-WS 2.0 construct or a good intention that may not be that helpful after all.  (Team:  should we get rid of the first constructor variant?  Is this even called for in JAX-WS?)

At any rate, if you look at how I constructed EntryAlreadyExistsFault in function addWordEntry() in [1] below, you'll see how you can create your exceptions so that they can be trapped on the client side.

HTH,
Glen

[1] http://www.jroller.com/gmazza/date/20071019#step6


> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Updated: (CXF-1136) Custom exception not appearing in SOAP fault response

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

ed p updated CXF-1136:
----------------------

    Attachment: helloworld.xsd

the xsd import referenced by the wsdl as:
http://localhost:8080/wsit-jaxws-fromjava/helloworld?xsd=1

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, helloworld.xsd, helloworld_glassfishmetro.wsdl, java_first_jaxws.zip, wsit-jaxws-fromjava.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538146 ] 

Glen Mazza commented on CXF-1136:
---------------------------------

Another option is to take a look at GlassFish Metro, with your current code.  If it is failing also there, it would appear to be something wrong with your coding.  

Quote: "Another possiblity as you mentioned is to perform a java to wsdl .. modify the wsdl .. perform wsdl to java but that's a huge workaround. If I have to resort to that then clearly CXF doesn't support pojo development with exceptions."

Not necessarily.  The steps I'm outlining are good for CXF/JAXB novices to figure out how to get the code right.  After doing the above, you can probably backport the generated code to what you presently have to figure out the exception problem.

Also, Dennis Sosnoski (who codes JiBX) also thinks that "java to wsdl .. modify the wsdl .. perform wsdl to java" is not that bad an idea:
http://www.infoq.com/articles/sosnoski-code-first

Glen


> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "Glen Mazza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537955 ] 

Glen Mazza commented on CXF-1136:
---------------------------------

OK, so once you get a reasonable approximation of your WSDL, why not modify it to add in the exceptions that you want, and then run wsdl2java, saving the artifacts from the java->wsdl process (if any) that you wish to reuse?  Your source of record should still be the WSDL, even if you mocked up java objects to approximate it.

Trying to torture your Java-first code to get a precise WSDL is difficult and time-consuming if you're not open to manual modification of the WSDL after you generate a workable approximation of it.  It's beyond my scope of knowledge, but perhaps more experienced users can help you here.

Have you looked at the WSDL on the server (viewable from your browser) as a result of your Java-first approach, and determined that it is equivalent to the WSDL that would work with exceptions under a WSDL-first approach?  I.e., my sample I linked to earlier, definitely handles exceptions properly, but it is WSDL-first.  Is your Java-first WSDL equivalent in structure?  If not, exceptions probably aren't going to work the way you want, and efforts would probably need to be made towards generating an equivalent WSDL--either by manual modification or Java class manipulation--before exceptions will work properly.


> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "ed p (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537887 ] 

ed p commented on CXF-1136:
---------------------------

even when I modify the CustomException to reference a CustomExceptionType and then throw the CustomException using the CustomException (String message, CustomExceptionType customException)  constructor it still behaves the same way. The exceptions I am using are not autogenerated because I am NOT taking a WSDL first approach. I am reverse engineering my java code to generate the WSDL as per the sample code that this was originally based on.

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "ed p (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537971 ] 

ed p commented on CXF-1136:
---------------------------

yes I understand where you are going but what I'm really trying to do is evaluate CXF for my project. The requirements of my project requires a Java first approach. CXF documentation states that it supports java/pojo development so I ran the pojo sample code and then added the modification of throwing an exception.
Now I am still not clear if there's a bug in the reverse engineering process or whether there is some sort of exception that I need to extend to get this to work or modifying my exception as in my previous comment. I took a look at XFire and to do what I want the exception needs to extend FaultInfoException and implement getFaultInfo and getFaultName. This actually worked in XFire but it doesn't work in CXF .. well the FaultInfoException isn't exactly the same as it is located in the client package.
Another possiblity as you mentioned is to perform a java to wsdl .. modify the wsdl .. perform wsdl to java but that's a huge workaround. If I have to resort to that then clearly CXF doesn't support pojo development with exceptions.

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Commented: (CXF-1136) Custom exception not appearing in SOAP fault response

Posted by "ed p (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537629 ] 

ed p commented on CXF-1136:
---------------------------

another thing to note the wsdl was derived as I took the java first approach.

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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


[jira] Updated: (CXF-1136) Custom exception not appearing in SOAP fault response

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

ed p updated CXF-1136:
----------------------

    Attachment: helloWorld.wsdl

generated wsdl

> Custom exception not appearing in SOAP fault response
> -----------------------------------------------------
>
>                 Key: CXF-1136
>                 URL: https://issues.apache.org/jira/browse/CXF-1136
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WIndows XP
> Java SDK 1.5_0_12
>            Reporter: ed p
>            Priority: Critical
>         Attachments: helloWorld.wsdl, java_first_jaxws.zip
>
>
> I modified the apache-cxf-2.0.2-incubator\samples\java_first_jaxws web service to throw a custom exception and a custom request and response object like so:
> public interface HelloWorld {
>     Response sayHi(Request text) throws CustomException;
> }
> CustomException is a CustomExceptionBase with two string properties. CustomExceptionBase is a java.lang.Exception
> The CustomException appears in the WSDL but the CustomExceptionBase is missing. When the service is invoked and throws a CustomException the soap response is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>custom error</faultstring>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
> I am expecting to see the CustomException serialized in the Envelope/Body/Fault/detail node.

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