/** * Process a successful response, i.e. one where the HTTP response code was 200. * * @param httpResponse the HTTP client response * @param soapContext the SOAP11Context instance * * @throws MessageDecodingException if message can not be unmarshalled * @throws IOException if there is a problem with the response entity input stream */ protected void processSuccessResponse(HttpResponse httpResponse, SOAP11Context soapContext) throws MessageDecodingException, IOException { if (httpResponse.getEntity() == null) { throw new MessageDecodingException("No response body from server"); } Envelope soapMessage = (Envelope) unmarshallMessage(httpResponse.getEntity().getContent()); // Defensive sanity check, otherwise body handler could later fail non-gracefully with runtime exception Fault fault = getFault(soapMessage); if (fault != null) { throw new SOAP11FaultDecodingException(fault); } soapContext.setEnvelope(soapMessage); soapContext.setHTTPResponseStatus(httpResponse.getStatusLine().getStatusCode()); }