You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Craig <su...@gmail.com> on 2008/09/30 01:02:27 UTC

trying to catch timeout exception on client side

Hi all,

disclaimer: very new to CXF, and slightly confused by the Interceptor concept.

I am simply trying to tell if my client side soap call failed because
of a socket
timeout. Unfortunately, the exception that gets thrown doesn't seem to
know anything about the timeout. I am able to catch a
WebServiceException, that has a SOAPException embedded as the cause,
that says "Unable to create SOAP factory.", which doesn't really help
me.

I know the timeout is causing the error because a) I set the timeout
to 1ms, and b) CXF (via jboss) is logging it in the eclipse console, e.g.

org.apache.cxf.interceptor.Fault: Read timed out
...
Caused by: java.net.SocketTimeoutException: Read timed out


How can I find out in my code what CXF apparently knows but doesn't tell me?


Many thanks,
Craig



Here is a code snippet:

JaxWsProxyFactoryBean myServiceService = new JaxWsProxyFactoryBean();
myServiceService.setServiceClass(...);
myServiceService.setAddress(...)
myServiceProxy = (MyService)myServiceService.create();

try {
 myServiceProxy.mySoapMethod();
}
catch(WebServiceException e) {
  //e doesn't seem to tell me anything about the timeout????? How can
I get a more specific exception?
}

Re: trying to catch timeout exception on client side

Posted by Craig <su...@gmail.com>.
I got a bounce from ezmlm...not sure if this went through.

On Tue, Sep 30, 2008 at 9:02 AM, Craig <su...@gmail.com> wrote:
> Hi all,
>
> disclaimer: very new to CXF, and slightly confused by the Interceptor concept.
>
> I am simply trying to tell if my client side soap call failed because
> of a socket
> timeout. Unfortunately, the exception that gets thrown doesn't seem to
> know anything about the timeout. I am able to catch a
> WebServiceException, that has a SOAPException embedded as the cause,
> that says "Unable to create SOAP factory.", which doesn't really help
> me.
>
> I know the timeout is causing the error because a) I set the timeout
> to 1ms, and b) CXF (via jboss) is logging it in the eclipse console, e.g.
>
> org.apache.cxf.interceptor.Fault: Read timed out
> ...
> Caused by: java.net.SocketTimeoutException: Read timed out
>
>
> How can I find out in my code what CXF apparently knows but doesn't tell me?
>
>
> Many thanks,
> Craig
>
>
>
> Here is a code snippet:
>
> JaxWsProxyFactoryBean myServiceService = new JaxWsProxyFactoryBean();
> myServiceService.setServiceClass(...);
> myServiceService.setAddress(...)
> myServiceProxy = (MyService)myServiceService.create();
>
> try {
>  myServiceProxy.mySoapMethod();
> }
> catch(WebServiceException e) {
>  //e doesn't seem to tell me anything about the timeout????? How can
> I get a more specific exception?
> }
>

Re: trying to catch timeout exception on client side

Posted by Craig <su...@gmail.com>.
Yes, thankyou, it works perfectly using the 2.2-SNAPSHOT! I get
SocketTimedoutExceptions, UnknownHostExceptions, etc. just as I would
expect.

So, next question, is waiting for a 2.2 release the only way to get
this functionality without using snapshots?

many thanks,
Craig

On Thu, Oct 2, 2008 at 4:00 AM, Daniel Kulp <dk...@apache.org> wrote:
>
>
> Any chance you could try with the 2.2-SNAPSHOTs?   I did SOME work around
> this as part of the policy stuff I've been working on (to get the policy
> exception).  It SHOULD be the "cause" of the WebServiceException, but,
> if I remember right, that wasn't working.
>
> Dan
>
>
> On Monday 29 September 2008, Craig wrote:
>> Hi all,
>>
>> disclaimer: very new to CXF, and slightly confused by the Interceptor
>> concept.
>>
>> I am simply trying to tell if my client side soap call failed because
>> of a socket
>> timeout. Unfortunately, the exception that gets thrown doesn't seem to
>> know anything about the timeout. I am able to catch a
>> WebServiceException, that has a SOAPException embedded as the cause,
>> that says "Unable to create SOAP factory.", which doesn't really help
>> me.
>>
>> I know the timeout is causing the error because a) I set the timeout
>> to 1ms, and b) CXF (via jboss) is logging it in the eclipse console,
>> e.g.
>>
>> org.apache.cxf.interceptor.Fault: Read timed out
>> ...
>> Caused by: java.net.SocketTimeoutException: Read timed out
>>
>>
>> How can I find out in my code what CXF apparently knows but doesn't
>> tell me?
>>
>>
>> Many thanks,
>> Craig
>>
>>
>>
>> Here is a code snippet:
>>
>> JaxWsProxyFactoryBean myServiceService = new JaxWsProxyFactoryBean();
>> myServiceService.setServiceClass(...);
>> myServiceService.setAddress(...)
>> myServiceProxy = (MyService)myServiceService.create();
>>
>> try {
>>  myServiceProxy.mySoapMethod();
>> }
>> catch(WebServiceException e) {
>>   //e doesn't seem to tell me anything about the timeout????? How can
>> I get a more specific exception?
>> }
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Re: trying to catch timeout exception on client side

Posted by Daniel Kulp <dk...@apache.org>.

Any chance you could try with the 2.2-SNAPSHOTs?   I did SOME work around 
this as part of the policy stuff I've been working on (to get the policy 
exception).  It SHOULD be the "cause" of the WebServiceException, but, 
if I remember right, that wasn't working.

Dan


On Monday 29 September 2008, Craig wrote:
> Hi all,
>
> disclaimer: very new to CXF, and slightly confused by the Interceptor
> concept.
>
> I am simply trying to tell if my client side soap call failed because
> of a socket
> timeout. Unfortunately, the exception that gets thrown doesn't seem to
> know anything about the timeout. I am able to catch a
> WebServiceException, that has a SOAPException embedded as the cause,
> that says "Unable to create SOAP factory.", which doesn't really help
> me.
>
> I know the timeout is causing the error because a) I set the timeout
> to 1ms, and b) CXF (via jboss) is logging it in the eclipse console,
> e.g.
>
> org.apache.cxf.interceptor.Fault: Read timed out
> ...
> Caused by: java.net.SocketTimeoutException: Read timed out
>
>
> How can I find out in my code what CXF apparently knows but doesn't
> tell me?
>
>
> Many thanks,
> Craig
>
>
>
> Here is a code snippet:
>
> JaxWsProxyFactoryBean myServiceService = new JaxWsProxyFactoryBean();
> myServiceService.setServiceClass(...);
> myServiceService.setAddress(...)
> myServiceProxy = (MyService)myServiceService.create();
>
> try {
>  myServiceProxy.mySoapMethod();
> }
> catch(WebServiceException e) {
>   //e doesn't seem to tell me anything about the timeout????? How can
> I get a more specific exception?
> }



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: trying to catch timeout exception on client side

Posted by Glen Mazza <gl...@gmail.com>.
Incidentally, are you using an asynchronous client (first paragraph of
[1])--that might provide additional options for you.

Glen

[1] http://www.jroller.com/gmazza/date/20080308


craigb wrote:
> 
> Hi all,
> 
> disclaimer: very new to CXF, and slightly confused by the Interceptor
> concept.
> 
> I am simply trying to tell if my client side soap call failed because
> of a socket
> timeout. Unfortunately, the exception that gets thrown doesn't seem to
> know anything about the timeout. I am able to catch a
> WebServiceException, that has a SOAPException embedded as the cause,
> that says "Unable to create SOAP factory.", which doesn't really help
> me.
> 
> I know the timeout is causing the error because a) I set the timeout
> to 1ms, and b) CXF (via jboss) is logging it in the eclipse console, e.g.
> 
> org.apache.cxf.interceptor.Fault: Read timed out
> ...
> Caused by: java.net.SocketTimeoutException: Read timed out
> 
> 
> How can I find out in my code what CXF apparently knows but doesn't tell
> me?
> 
> 
> Many thanks,
> Craig
> 
> 
> 
> Here is a code snippet:
> 
> JaxWsProxyFactoryBean myServiceService = new JaxWsProxyFactoryBean();
> myServiceService.setServiceClass(...);
> myServiceService.setAddress(...)
> myServiceProxy = (MyService)myServiceService.create();
> 
> try {
>  myServiceProxy.mySoapMethod();
> }
> catch(WebServiceException e) {
>   //e doesn't seem to tell me anything about the timeout????? How can
> I get a more specific exception?
> }
> 
> 

-- 
View this message in context: http://www.nabble.com/trying-to-catch-timeout-exception-on-client-side-tp19733378p19768241.html
Sent from the cxf-user mailing list archive at Nabble.com.