throw new InvalidStatusResponseException(response);
throw new Exception("Invalid status response: " + response);
    public void process(MessageExchange exchange) throws Exception {        if (exchange.getStatus() == ExchangeStatus.DONE) {            return;        } else if (exchange.getStatus() == ExchangeStatus.ERROR) {            exchange.setStatus(ExchangeStatus.DONE);            channel.send(exchange);            return;        }        PostMethod method = new PostMethod(endpoint.getLocationURI());        marshaler.fromNMS(method, exchange, exchange.getMessage("in"));        int response = getClient().executeMethod(host, method);        if (response != HttpStatus.SC_OK) {            throw new InvalidStatusResponseException(response);        }        if (exchange instanceof InOut) {            NormalizedMessage msg = exchange.createMessage();            marshaler.toNMS(msg, method);            ((InOut) exchange).setOutMessage(msg);            channel.sendSync(exchange);        } else if (exchange instanceof InOptionalOut) {            if (method.getResponseContentLength() == 0) {                exchange.setStatus(ExchangeStatus.DONE);                channel.send(exchange);            } else {                NormalizedMessage msg = exchange.createMessage();                marshaler.toNMS(msg, method);                ((InOptionalOut) exchange).setOutMessage(msg);                channel.sendSync(exchange);            }        } else {            exchange.setStatus(ExchangeStatus.DONE);            channel.send(exchange);        }    }