You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jim Talbut <jt...@spudsoft.co.uk> on 2012/06/08 13:21:36 UTC

What went wrong?

Hi,

How can my CXF client tell what type of thing went wrong?
I want to be able to classify faults into network faults and remote 
server faults, because the response to the two is very different.
If I simply call the proxy with a few different failures all I get is a 
SOAPFaultException with a cause of a SoapFault exception.
I was hoping that the network fault would have a root cause of some kind 
of IOException.

This pair was caused by accessing a port that wasn't listening:
TestBrokenNetwork::test1] Exception: class 
javax.xml.ws.soap.SOAPFaultException: Could not send Message.
TestBrokenNetwork::test1] Exception: class 
org.apache.cxf.binding.soap.SoapFault: Could not send Message.

This was caused by an IllegalArgumentException thrown within the server 
implementation:
TestLogging::testException] Exception: class 
javax.xml.ws.soap.SOAPFaultException: You passed in the illegal word
TestLogging::testException] Exception: class 
org.apache.cxf.binding.soap.SoapFault: You passed in the illegal word

This was caused by an explicit throw of a SoapFault by the server 
implementation:
TestLogging::testSoapFault] Exception: class 
javax.xml.ws.soap.SOAPFaultException: You passed in the triger word
TestLogging::testSoapFault] Exception: class 
org.apache.cxf.binding.soap.SoapFault: You passed in the triger word

Is there any way to get more detail for classification?

Thanks.

Jim

Re: What went wrong?

Posted by Jim Talbut <jt...@spudsoft.co.uk>.
Do you mean as in real W3C SOAP faults?
That won't help, there isn't a real W3C SOAP fault - but CXF is 
pretending that there is and (unless I've missed something) preventing 
me from accessing the underlying IOException.

The situations in which I throw a proper SOAP fault are working just 
fine (whether I throw one defined in the WSDL or not).

Jim

On 08/06/2012 19:11, Benson Margulies wrote:
> Read up on SOAP faults?
>
> On Fri, Jun 8, 2012 at 7:21 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
>> Hi,
>>
>> How can my CXF client tell what type of thing went wrong?
>> I want to be able to classify faults into network faults and remote server
>> faults, because the response to the two is very different.
>> If I simply call the proxy with a few different failures all I get is a
>> SOAPFaultException with a cause of a SoapFault exception.
>> I was hoping that the network fault would have a root cause of some kind of
>> IOException.
>>
>> This pair was caused by accessing a port that wasn't listening:
>> TestBrokenNetwork::test1] Exception: class
>> javax.xml.ws.soap.SOAPFaultException: Could not send Message.
>> TestBrokenNetwork::test1] Exception: class
>> org.apache.cxf.binding.soap.SoapFault: Could not send Message.
>>
>> This was caused by an IllegalArgumentException thrown within the server
>> implementation:
>> TestLogging::testException] Exception: class
>> javax.xml.ws.soap.SOAPFaultException: You passed in the illegal word
>> TestLogging::testException] Exception: class
>> org.apache.cxf.binding.soap.SoapFault: You passed in the illegal word
>>
>> This was caused by an explicit throw of a SoapFault by the server
>> implementation:
>> TestLogging::testSoapFault] Exception: class
>> javax.xml.ws.soap.SOAPFaultException: You passed in the triger word
>> TestLogging::testSoapFault] Exception: class
>> org.apache.cxf.binding.soap.SoapFault: You passed in the triger word
>>
>> Is there any way to get more detail for classification?
>>
>> Thanks.
>>
>> Jim



Re: What went wrong?

Posted by Benson Margulies <bi...@gmail.com>.
Read up on SOAP faults?

On Fri, Jun 8, 2012 at 7:21 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
> Hi,
>
> How can my CXF client tell what type of thing went wrong?
> I want to be able to classify faults into network faults and remote server
> faults, because the response to the two is very different.
> If I simply call the proxy with a few different failures all I get is a
> SOAPFaultException with a cause of a SoapFault exception.
> I was hoping that the network fault would have a root cause of some kind of
> IOException.
>
> This pair was caused by accessing a port that wasn't listening:
> TestBrokenNetwork::test1] Exception: class
> javax.xml.ws.soap.SOAPFaultException: Could not send Message.
> TestBrokenNetwork::test1] Exception: class
> org.apache.cxf.binding.soap.SoapFault: Could not send Message.
>
> This was caused by an IllegalArgumentException thrown within the server
> implementation:
> TestLogging::testException] Exception: class
> javax.xml.ws.soap.SOAPFaultException: You passed in the illegal word
> TestLogging::testException] Exception: class
> org.apache.cxf.binding.soap.SoapFault: You passed in the illegal word
>
> This was caused by an explicit throw of a SoapFault by the server
> implementation:
> TestLogging::testSoapFault] Exception: class
> javax.xml.ws.soap.SOAPFaultException: You passed in the triger word
> TestLogging::testSoapFault] Exception: class
> org.apache.cxf.binding.soap.SoapFault: You passed in the triger word
>
> Is there any way to get more detail for classification?
>
> Thanks.
>
> Jim

Re: What went wrong?

Posted by Jim Talbut <jt...@spudsoft.co.uk>.
Dan,

What you say is precisely what I was expecting, but I wasn't seeing it.
And that's because I had a proxy that was mangling the exception as seen 
at the client end.

Doh! Doh! Doh!
Sorry for wasting everyones' time.

Jim

On 08/06/2012 20:10, Daniel Kulp wrote:
> On Friday, June 08, 2012 08:05:23 PM Jim Talbut wrote:
>> Thanks, it is a good article, but I've already got that aspect working.
>> If I throw a SOAP fault (whether declared in the WSDL or not) everything
>> behaves as I want it to.
>>
>> The problem is that the CXF client is converting an IOException into a
>> SoapFault and losing the IOException.
>> It does log when it does this, but I want the information available to
>> my client.
> Any original exception from the client side should be available in the
> "cause" of any exception we through.   You may want to check those.
>
> Dan
>
>
>
>> Jim
>>
>> On 08/06/2012 19:20, Mark Streit wrote:
>>> This is a really good article discussing handling Exceptions from JAX-WS
>>> services over the wire:
>>>
>>> http://io.typepad.com/eben_hewitt_on_java/2009/07/using-soap-faults-and-
>>> exceptions-in-java-jaxws-web-services.html>
>>> On Fri, Jun 8, 2012 at 7:21 AM, Jim Talbut <jt...@spudsoft.co.uk>
> wrote:
>>>> Hi,
>>>>
>>>> How can my CXF client tell what type of thing went wrong?
>>>> I want to be able to classify faults into network faults and remote
>>>> server faults, because the response to the two is very different.
>>>> If I simply call the proxy with a few different failures all I get is a
>>>> SOAPFaultException with a cause of a SoapFault exception.
>>>> I was hoping that the network fault would have a root cause of some
>>>> kind
>>>> of IOException.
>>>>
>>>> This pair was caused by accessing a port that wasn't listening:
>>>> TestBrokenNetwork::test1] Exception: class
>>>> javax.xml.ws.soap.**SOAPFaultException: Could not send Message.
>>>> TestBrokenNetwork::test1] Exception: class
>>>> org.apache.cxf.binding.soap.**SoapFault: Could not send Message.
>>>>
>>>> This was caused by an IllegalArgumentException thrown within the server
>>>> implementation:
>>>> TestLogging::testException] Exception: class
>>>> javax.xml.ws.soap.**SOAPFaultException: You passed in the illegal word
>>>> TestLogging::testException] Exception: class
>>>> org.apache.cxf.binding.soap.* *SoapFault: You passed in the illegal
>>>> word
>>>>
>>>> This was caused by an explicit throw of a SoapFault by the server
>>>> implementation:
>>>> TestLogging::testSoapFault] Exception: class
>>>> javax.xml.ws.soap.**SOAPFaultException: You passed in the triger word
>>>> TestLogging::testSoapFault] Exception: class
>>>> org.apache.cxf.binding.soap.* *SoapFault: You passed in the triger
>>>> word
>>>>
>>>> Is there any way to get more detail for classification?
>>>>
>>>> Thanks.
>>>>
>>>> Jim
>>> *Mark**



Re: What went wrong?

Posted by Daniel Kulp <dk...@apache.org>.
On Friday, June 08, 2012 08:05:23 PM Jim Talbut wrote:
> Thanks, it is a good article, but I've already got that aspect working.
> If I throw a SOAP fault (whether declared in the WSDL or not) everything
> behaves as I want it to.
> 
> The problem is that the CXF client is converting an IOException into a
> SoapFault and losing the IOException.
> It does log when it does this, but I want the information available to
> my client.

Any original exception from the client side should be available in the 
"cause" of any exception we through.   You may want to check those.

Dan



> Jim
> 
> On 08/06/2012 19:20, Mark Streit wrote:
> > This is a really good article discussing handling Exceptions from JAX-WS
> > services over the wire:
> > 
> > http://io.typepad.com/eben_hewitt_on_java/2009/07/using-soap-faults-and-
> > exceptions-in-java-jaxws-web-services.html> 
> > On Fri, Jun 8, 2012 at 7:21 AM, Jim Talbut <jt...@spudsoft.co.uk> 
wrote:
> >> Hi,
> >> 
> >> How can my CXF client tell what type of thing went wrong?
> >> I want to be able to classify faults into network faults and remote
> >> server faults, because the response to the two is very different.
> >> If I simply call the proxy with a few different failures all I get is a
> >> SOAPFaultException with a cause of a SoapFault exception.
> >> I was hoping that the network fault would have a root cause of some
> >> kind
> >> of IOException.
> >> 
> >> This pair was caused by accessing a port that wasn't listening:
> >> TestBrokenNetwork::test1] Exception: class
> >> javax.xml.ws.soap.**SOAPFaultException: Could not send Message.
> >> TestBrokenNetwork::test1] Exception: class
> >> org.apache.cxf.binding.soap.**SoapFault: Could not send Message.
> >> 
> >> This was caused by an IllegalArgumentException thrown within the server
> >> implementation:
> >> TestLogging::testException] Exception: class
> >> javax.xml.ws.soap.**SOAPFaultException: You passed in the illegal word
> >> TestLogging::testException] Exception: class
> >> org.apache.cxf.binding.soap.* *SoapFault: You passed in the illegal
> >> word
> >> 
> >> This was caused by an explicit throw of a SoapFault by the server
> >> implementation:
> >> TestLogging::testSoapFault] Exception: class
> >> javax.xml.ws.soap.**SOAPFaultException: You passed in the triger word
> >> TestLogging::testSoapFault] Exception: class
> >> org.apache.cxf.binding.soap.* *SoapFault: You passed in the triger
> >> word
> >> 
> >> Is there any way to get more detail for classification?
> >> 
> >> Thanks.
> >> 
> >> Jim
> > 
> > *Mark**
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: What went wrong?

Posted by Jim Talbut <jt...@spudsoft.co.uk>.
Thanks, it is a good article, but I've already got that aspect working.
If I throw a SOAP fault (whether declared in the WSDL or not) everything 
behaves as I want it to.

The problem is that the CXF client is converting an IOException into a 
SoapFault and losing the IOException.
It does log when it does this, but I want the information available to 
my client.

Jim

On 08/06/2012 19:20, Mark Streit wrote:
> This is a really good article discussing handling Exceptions from JAX-WS
> services over the wire:
>
> http://io.typepad.com/eben_hewitt_on_java/2009/07/using-soap-faults-and-exceptions-in-java-jaxws-web-services.html
>
> On Fri, Jun 8, 2012 at 7:21 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:
>
>> Hi,
>>
>> How can my CXF client tell what type of thing went wrong?
>> I want to be able to classify faults into network faults and remote server
>> faults, because the response to the two is very different.
>> If I simply call the proxy with a few different failures all I get is a
>> SOAPFaultException with a cause of a SoapFault exception.
>> I was hoping that the network fault would have a root cause of some kind
>> of IOException.
>>
>> This pair was caused by accessing a port that wasn't listening:
>> TestBrokenNetwork::test1] Exception: class javax.xml.ws.soap.**SOAPFaultException:
>> Could not send Message.
>> TestBrokenNetwork::test1] Exception: class org.apache.cxf.binding.soap.**SoapFault:
>> Could not send Message.
>>
>> This was caused by an IllegalArgumentException thrown within the server
>> implementation:
>> TestLogging::testException] Exception: class javax.xml.ws.soap.**SOAPFaultException:
>> You passed in the illegal word
>> TestLogging::testException] Exception: class org.apache.cxf.binding.soap.*
>> *SoapFault: You passed in the illegal word
>>
>> This was caused by an explicit throw of a SoapFault by the server
>> implementation:
>> TestLogging::testSoapFault] Exception: class javax.xml.ws.soap.**SOAPFaultException:
>> You passed in the triger word
>> TestLogging::testSoapFault] Exception: class org.apache.cxf.binding.soap.*
>> *SoapFault: You passed in the triger word
>>
>> Is there any way to get more detail for classification?
>>
>> Thanks.
>>
>> Jim
>>
>
> *Mark**



Re: What went wrong?

Posted by Mark Streit <mc...@gmail.com>.
This is a really good article discussing handling Exceptions from JAX-WS
services over the wire:

http://io.typepad.com/eben_hewitt_on_java/2009/07/using-soap-faults-and-exceptions-in-java-jaxws-web-services.html

On Fri, Jun 8, 2012 at 7:21 AM, Jim Talbut <jt...@spudsoft.co.uk> wrote:

> Hi,
>
> How can my CXF client tell what type of thing went wrong?
> I want to be able to classify faults into network faults and remote server
> faults, because the response to the two is very different.
> If I simply call the proxy with a few different failures all I get is a
> SOAPFaultException with a cause of a SoapFault exception.
> I was hoping that the network fault would have a root cause of some kind
> of IOException.
>
> This pair was caused by accessing a port that wasn't listening:
> TestBrokenNetwork::test1] Exception: class javax.xml.ws.soap.**SOAPFaultException:
> Could not send Message.
> TestBrokenNetwork::test1] Exception: class org.apache.cxf.binding.soap.**SoapFault:
> Could not send Message.
>
> This was caused by an IllegalArgumentException thrown within the server
> implementation:
> TestLogging::testException] Exception: class javax.xml.ws.soap.**SOAPFaultException:
> You passed in the illegal word
> TestLogging::testException] Exception: class org.apache.cxf.binding.soap.*
> *SoapFault: You passed in the illegal word
>
> This was caused by an explicit throw of a SoapFault by the server
> implementation:
> TestLogging::testSoapFault] Exception: class javax.xml.ws.soap.**SOAPFaultException:
> You passed in the triger word
> TestLogging::testSoapFault] Exception: class org.apache.cxf.binding.soap.*
> *SoapFault: You passed in the triger word
>
> Is there any way to get more detail for classification?
>
> Thanks.
>
> Jim
>


*Mark**
*