@Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException
    {
        LOGGER.info("message received");
        String ip = req.getRemoteHost();
        String result = "";
        
        InputStream is = null;
        OutputStream os = null;
        try
        {
            if (!ips.contains(ip))
            {
                result = ssoService.buildResMsgBody("2", new SSOResult());
                LOGGER.warn("The ip :" + ip + " is not allowed to access eSDK SSO service.");
            }
            else
            {
                is = req.getInputStream();
                String message = inputStream2String(is);
                LOGGER.debug("The request xml message is :" + MaskUtils.maskXMLElementValue(message, "pwd"));
                result = ssoService.ssoAuth(message);
                LOGGER.debug("The response xml message is " + result);
            }
            
        }
        catch (Exception e)
        {
            LOGGER.error(e.getMessage(), e);
            result = ssoService.buildResMsgBody("-1", new SSOResult());
        }
        finally
        {
            try
            {
                if (null != is)
                {
                    is.close();
                }
            }
            catch (IOException e)
            {
                LOGGER.error(e);
            }
        }
        
        try
        {
            os = resp.getOutputStream();
            os.write(result.getBytes("UTF-8"));
        }
        catch (IOException e)
        {
            LOGGER.error(e);
        }
        finally
        {
            try
            {
                if (null != os)
                {
                    os.close();
                }
            }
            catch (IOException e)
            {
                LOGGER.error(e);
            }
        }
        LOGGER.info("message processed");
    }