新增航班动态信息处理
This commit is contained in:
@@ -22,9 +22,10 @@ public class ExchangeServiceImpl implements IExchangeService {
|
||||
Map map;
|
||||
ObjectMapper xmlMapper = new XmlMapper();
|
||||
map = xmlMapper.readValue(xml, Map.class);
|
||||
map.remove("noNamespaceSchemaLocation");
|
||||
|
||||
ObjectMapper jsonMapper = new ObjectMapper();
|
||||
String json = jsonMapper.writeValueAsString(map);
|
||||
String json = jsonMapper.writer().withDefaultPrettyPrinter().writeValueAsString(map);
|
||||
return json;
|
||||
} catch (JsonParseException e) {
|
||||
throw new ExchangeServiceException(e.getMessage(),e);
|
||||
|
||||
Reference in New Issue
Block a user