Example usage for org.json XMLToJson XMLToJson

List of usage examples for org.json XMLToJson XMLToJson

Introduction

In this page you can find the example usage for org.json XMLToJson XMLToJson.

Prototype

public XMLToJson(String basePath) 

Source Link

Usage

From source file:mayo.edu.server.JsonServiceImpl.java

@Override
public String getJsonFromXml(String xml) throws IllegalArgumentException {
    return new XMLToJson(getBasePath()).toJson(xml);
}

From source file:mayo.edu.server.JsonServiceImpl.java

@Override
public XmlJsonResponse getJsonFromRestService(String restUrl) throws IllegalArgumentException {

    String xml = makeRestCall(restUrl);
    String json = new XMLToJson(getBasePath()).toJson(xml);

    XmlJsonResponse response = new XmlJsonResponse();
    response.setJson(json);// w ww. j a  va2  s.co m
    response.setXml(xml);

    return response;
}