public JSONObject addPrintService(HttpSession session, JSONObject json) {
try {
BarcodableSchema barcodableSchema = printManager.getBarcodableSchema(json.getString("schema"));
MisoPrintService printService = new DefaultPrintService();
if ("Custom".equals(json.getString("serviceFor"))) {
printService = new CustomPrintService();
}
printService.setName(json.getString("serviceName"));
PrintContext pc = printManager.getPrintContext(json.getString("contextName"));
JSONObject contextFields = JSONObject.fromObject(json.getString("contextFields"));
PrintServiceUtils.mapJSONToContextFields(contextFields, pc);