//Always remember to include all the import at the beginning of the custom plug-in script import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.json.JSONObject; import org.json.XML; import com.adeptia.indigo.services.ServiceException; InputStreamReader is = null; BufferedReader br = null; StringBuilder sb = null; try { // Read the input stream and covert into string object is = new InputStreamReader(inputStream); sb = new StringBuilder(); br = new BufferedReader(is); String read = br.readLine(); while (read != null) { // System.out.println(read); sb.append(read); read = br.readLine(); } // Convert the String object to XML and write in the default name // stream String xml = XML.toString(new JSONObject(sb.toString())); service.write(xml.getBytes(), "default"); } catch (Exception e) { // TODO Auto-generated catch block throw new ServiceException(e); } finally { if (br != null) { try { br.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if (is != null) { try { is.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }