messageLogger.logDebug("Response content type is '" + response.getContentType() + "'");
    public void doPost(final HttpServletRequest request, final HttpServletResponse response) {        /* Avoid null-pointer exceptions. */        if (request == null) {            messageLogger.logCritical("Response object cannot be null", new NullPointerException("request is null"));            return;        }        if (response == null) {            messageLogger.logCritical("Response object cannot be null", new NullPointerException("response is null"));            return;        }        /* Supposed to boost performace. */        response.setBufferSize(8192);        /* The access point to the AXIS subsystem. */        AxisEngine axisEngine = null;        /* The objecte representing the incoming SOAP message. */        Message requestMessage = null;        /* The object representing the requested web service. */        SOAPService service = null;        /* Retrieve instance of AXIS engine. */        try {            axisEngine = getEngine();        } catch (AxisFault fault) {            handleException("Unable to get AxisEngine", fault, request, response);            return;        }        /*         * Create message context used by the AXIS subsystem to handle the         * request.         */        MessageContext messageContext = createMessageContext(axisEngine, request, response);        /* Set the username given in the request. */        messageContext.setUsername(request.getRemoteUser());        /* Identify service. */        String serviceName = request.getServletPath();        /*         * Retrieve SOAP service object. Make NullPointerException page and         * return if SOAP service is null.         */        try {            service = axisEngine.getService(serviceName);        } catch (AxisFault fault) {            handleException("Unable to get SOAPService", fault, request, response);            return;        }        if (service == null) {            handleException("No SOAPService object returned", new NullPointerException("service is null"), request, response);            return;        }        /* Add the SOAP service to message context. */        try {            messageContext.setService(service);        } catch (AxisFault af) {            handleException("Unable to set SOAPService in messageContext", af, request, response);            return;        }        /*         * Create request message. Log and return if we can't get input stream         * from request.         */        try {            requestMessage = new Message(request.getInputStream(), false, request.getHeader("Content-Type"), request.getHeader("Content-Location"));        } catch (IOException ioe) {            handleException("Unable to get InputStream from request", ioe, request, response);            return;        }        /* Add the request message to the message context. */        messageContext.setRequestMessage(requestMessage);        /* Get the SOAP action header from the HTTP request. */        String soapAction = request.getHeader("SOAPAction");        /*         * If the SoapAction header is undefined we set the variable equal to         * the request uri.         */        if (soapAction == null)            soapAction = request.getRequestURI();        /* Add the SOAP action to the message context. */        messageContext.setUseSOAPAction(true);        messageContext.setSOAPActionURI(soapAction);        /* Create session wrapper for the HTTP session. */        messageContext.setSession(new AxisHttpSession(request));        /*         * Invoke the engine and thereby process the request, log and return if         * it fails.         */        try {            axisEngine.invoke(messageContext);        } catch (AxisFault af) {                        if ((af.getFaultString().startsWith("No such operation")) ||                (af.getFaultString().startsWith("org.xml.sax.SAXException"))) {                                // Handle exceptions caused by illegal input.                IllegalInputException e = new IllegalInputException(af.getFaultString());                handleException("Invocation of the Axis engine failed", e, request, response);                                          } else                                // All other Axis exceptions.                handleException("Invocation of the axis engine failed", af, request, response);            return;        }        /* Read response message from engine. */        Message responseMessage = messageContext.getResponseMessage();        /* Log and return if no response. */        if (responseMessage == null) {            handleException("No response from engine", new NullPointerException("responseMessage is null"), request, response);            return;        }        /*         * If we're unable to retrieve the content type, set it to a default         * value.         */        try {            response.setContentType(responseMessage.getContentType(messageContext.getSOAPConstants()));        } catch (AxisFault af) {            handleException("Unable to retrieve content type of response", af, request, response);            // TODO: Verify default content type for SOAP messages            response.setContentType("application/soap+xml");        }        /* Write message to client */        try {            responseMessage.writeTo(response.getOutputStream());        } catch (Exception e) {            handleException("Unable to write response to client", e, request, response);            return;        }    }