//接收请求发来的xml消息体,并返回xml字符串
public static String recieveData(HttpServletRequest request)
    {
       
        String inputLine = null;
        // 接收到的数据
        StringBuffer recieveData = new StringBuffer();
       
        BufferedReader in = null;
        try
        {
            in = new BufferedReader(new InputStreamReader(
                    request.getInputStream(), "UTF-8"));
            while ((inputLine = in.readLine()) != null)
            {
                recieveData.append(inputLine);
            }
        }
        catch (IOException e)
        {
        }
        finally
        {
           
            try
            {
                if (null != in)
                {
                    in.close();
                }
            }
            catch (IOException e)
            {
            }
           
        }
       
        return recieveData.toString();
    }

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-09-09
  • 2021-08-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2022-02-03
相关资源
相似解决方案