예제 #1
0
  public String getAirLines(String start, String end, String date) {
    String re = null;

    try {
      GetDomesticAirlinesTimeResponseGetDomesticAirlinesTimeResult res =
          client.getDomesticAirlinesTime(start, end, date, "");

      MessageElement[] mes = res.get_any();
      List body = mes[1].getChildren();
      if (body.size() <= 0) {
        return new JSONArray().toString();
      }
      String nn = Xml2JsonUtil.xml2JSON(body.get(0).toString());
      JSONObject json;
      try {
        json = new JSONObject(nn);
        re = json.getJSONObject("Airlines").getJSONArray("AirlinesTime").toString();
      } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    return re;
  }
예제 #2
0
  public String getAllCity() {
    String re = null;
    try {
      GetDomesticCityResponseGetDomesticCityResult res = client.getDomesticCity();
      MessageElement[] me = res.get_any();
      List body = me[1].getChildren();
      if (body.size() < 0) {
        return new JSONArray().toString();
      }
      String nn = Xml2JsonUtil.xml2JSON(body.get(0).toString());
      JSONObject json;
      try {
        json = new JSONObject(nn);
        re = json.getJSONObject("Airline1").getJSONArray("Address").toString();
      } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    return re;
  }