Hi ext2,
I just checked the HTTPConduit code,
It checks the response code before checking the MEP, maybe you need to
try the latest CXF code.
if (responseCode >= 400 && responseCode != 500 &&
!noExceptions) {
throw new HTTPException(responseCode,
connection.getResponseMessage(),
connection.getURL());
}
InputStream in = null;
if (isOneway(exchange)) {
in = ChunkedUtil.getPartialResponse(connection,
responseCode);
if (in == null) {
// oneway operation or decoupled MEP without
// partial response
connection.getInputStream().close();
return;
}
}
On 5/31/11 4:49 PM, ext2 wrote:
Following is the source code, illustrate why existing CXF HTTPConduit cannot
deal with 500 response
HTTPConduit.WrappedOutputStream.handleResponseInternal(){
if (isOneway(exchange)) {
//here: ChunkedUtil.getPartialResponse doesn't deal with 500 response, always
return NULL inputstream( but we can modify it to support 500 response)
in = ChunkedUtil.getPartialResponse(connection, responseCode);
if (in == null) {
//so connection.getInputStream() is called, then a Exception will be raised (As
only connection.getErrorStream() is allowed for 500 response)
connection.getInputStream().close();
return;
}
}
}
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang