接收数据:
request.setCharacterEncoding("UTF-8"); response.setContentType("application/xml"); //orderno 即shopOrder 中的 orderSn InputStream is = request.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is,"UTF-8")); StringBuffer sb = new StringBuffer(); String line; while ((line = reader.readLine()) != null) { sb.append(line); } logger.info("notice_msg:" + sb.toString()); //String xmlStr = sb.toString();
写入:
response.getWriter().write(errorXml("05","缺少设备ID信息(termid)"));
测试postman: raw