zoukankan      html  css  js  c++  java
  • springboot调xml数据

    applocation.properties 配置  EVNANA_METHOD_URL = http://192.168.111.230:8080/YJServices/getEvnAnaData

    Controller

    // MVC视图模板后缀路径 @Value("${EVNANA_METHOD_URL}") private String evnAnaMethodUrl;

    HttpClient evnAnaClient = new HttpClient();
    HttpMethod evnAnaMethod = new UTF8PostMethod(evnAnaMethodUrl);
    ((PostMethod) evnAnaMethod).setParameter("width",  request.getParameter("width"));
    ((PostMethod) evnAnaMethod).setParameter("density", request.getParameter("density"));
    evnAnaClient.executeMethod(evnAnaMethod);// 执行请求
    String retXmlStr = evnAnaMethod.getResponseBodyAsString();// 返回结果
    // 解析返回xml
    Document document = DocumentHelper.parseText(retXmlStr);
    Element rootNode = document.getRootElement();
    // System.out.println(rootNode.getName());

    // 遍历近距离点位--------------------------------------------------
    Map<String, Object> lowMap = new HashMap<String, Object>();
    Element lowEle = rootNode.element("low");
  • 相关阅读:
    CF Spreadsheets (数学)
    CF Theatre Square
    CF Error Correct System
    CF Playing with Paper
    HDU 3533 Escape (BFS + 预处理)
    nginx配置文件
    nginx配置文件详解
    Jenkins+maven+gitlab+shell实现项目自动化部署
    jenkins升级
    jenkins相关下载链接
  • 原文地址:https://www.cnblogs.com/yanqb/p/14325294.html
Copyright © 2011-2022 走看看