Thankyou very much Daniel. I will try to register an interceptor to remap the error code.
I have one final question - IF in my case there is no fault processing triggered on the service side (because of one-way ws) and the response that I get from service does not have a fault chain, Will registering an interceptor on client side to remap the error code help. Just wanted to confirm the steps I am taking are correct. Regards, Amol -----Original Message----- From: Daniel Kulp [mailto:[email protected]] Sent: Monday, July 23, 2012 4:53 PM To: [email protected] Cc: Deshpande, Amol Subject: Re: Webservice Unavailable - Internal Server Error (Response Code 500) not handled in HTTPConduit.java(One way webservice) On Monday, July 23, 2012 04:57:33 PM Deshpande, Amol wrote: > Thanks a lot Daniel for looking into my question. > > In my case, I have a one-way web service and hence no soap-faults are > returned. Not completely true.... A fault could be returned in some cases, even for one ways. If there is a problem processing the incoming message prior to being able to determine that it is a one way, a fault will be returned. For example, if the body is encrypted, but there is a security issue with the message, we cannot know it is a one-way and a fault would come back. > So, is there a way to handle responses that have a response > code 500? No. If it's a 500, we will process it along the incoming fault chain. You could register an interceptor along there someplace to remap it to something else if you want. Dan > I hope my question makes sense. > > Thanks, > Amol > > -----Original Message----- > From: Daniel Kulp [mailto:[email protected]] > Sent: Monday, July 23, 2012 12:32 PM > To: Deshpande, Amol > Cc: [email protected] > Subject: Re: Webservice Unavailable - Internal Server Error (Response Code > 500) not handled in HTTPConduit.java(One way webservice) > On Monday, July 23, 2012 04:29:05 PM Deshpande, Amol wrote: > > Thanks Daniel, > > > > But it still leaves out the question of handling the Internal Server > > Errors (Response Code : 500). My client currently is not able to handle > > the Internal Server Error and hence my question. > > > > Any internal server error thrown from the server side is suppressed by > > the HttpConduit.java class.. > > > > Can you let me know your thoughts about the same. > > The current behavior is correct for that. The soap faults are > transferred with response code 500 so we need to make sure an exception > is NOT thrown for that and that we process them as soap faults. > > Dan > > > Thanks, > > Amol > > > > > > -----Original Message----- > > From: Daniel Kulp [mailto:[email protected]] > > Sent: Monday, July 23, 2012 12:07 PM > > To: [email protected] > > Cc: Deshpande, Amol > > Subject: Re: Webservice Unavailable - Internal Server Error (Response > > Code 500) not handled in HTTPConduit.java(One way webservice) > > > > On Monday, July 23, 2012 03:22:02 PM Deshpande, Amol wrote: > > > Hi, > > > > > > I am working on a CXF client for a one way JAX-RPC webservice. > > > I am testing a scenario where, the webservice is unavailable (The > > > application for the webservice on the server is stopped) > > > > > > In this case, the server sends back a response Internal server error > > > (Response code 500) > > > > > > This response code is not handled by the > > > httpConduit.handleResponseInternal() function because it does not > > > throw > > > an error for response code 500. > > > > It's likely an bug on the server side. I SHOULD likely send a 404 in > > this case, not a 500. > > > > Dan > > > > > if (responseCode == HttpURLConnection.HTTP_NOT_FOUND && > > > !MessageUtils.isTrue(outMessage.getContextualProperty( > > > "org.apache.cxf.http.no_io_exceptions"))) { throw new > > > IOException("HTTP > > > response '" + responseCode + ": " + connection.getResponseMessage() + > > > "'"); } > > > > > > Can you please let me know if this is a known issue or if there is a > > > workaround to handle this? > > > > > > > > > Thanks, > > > Amol -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
