private void setResponseElements ( IntuitMessage intuitMessage , HttpResponse httpResponse ) throws FMSException { ResponseElements responseElements = intuitMessage . getResponseElements ( ) ; if ( httpResponse . getLastHeader ( RequestElements . HEADER_PARAM_CONTENT_ENCODING ) != null ) { responseElements . setEncodingHeader ( httpResponse . getLastHeader ( RequestElements . HEADER_PARAM_CONTENT_ENCODING ) . getValue ( ) ) ; } else { responseElements . setEncodingHeader ( null ) ; } if ( httpResponse . getLastHeader ( RequestElements . HEADER_PARAM_CONTENT_TYPE ) != null ) { responseElements . setContentTypeHeader ( httpResponse . getLastHeader ( RequestElements . HEADER_PARAM_CONTENT_TYPE ) . getValue ( ) ) ; } else { responseElements . setContentTypeHeader ( null ) ; } responseElements . setStatusLine ( httpResponse . getStatusLine ( ) ) ; responseElements . setStatusCode ( httpResponse . getStatusLine ( ) . getStatusCode ( ) ) ; try { responseElements . setResponseContent ( getCopyOfResponseContent ( httpResponse . getEntity ( ) . getContent ( ) ) ) ; } catch ( IllegalStateException e ) { LOG . error ( "IllegalStateException while get the content from HttpRespose." , e ) ; throw new FMSException ( e ) ; } catch ( Exception e ) { LOG . error ( "IOException in HTTPClientConnectionInterceptor while reading the entity from HttpResponse." , e ) ; throw new FMSException ( e ) ; } }
Method to set the response elements by reading the values from HttpResponse