Ejemplo n.º 1
0
  private static InputSource getConfigSource(File pAppFile) throws FileNotFoundException {
    InputSource retSource = null;
    String uri = FileUtils.createFileURL(pAppFile);

    FileInputStream fileInputStream = new FileInputStream(pAppFile);
    retSource = new InputSource(fileInputStream);
    retSource.setSystemId(uri);
    return (retSource);
  }
Ejemplo n.º 2
0
  public static void main(String[] args) {
    Debug.enableAll();
    String HEADER =
        "<HEADER>"
            + "<REQUEST value=\"LSR_ORDER\"/>"
            + "<SUB_REQUEST value=\"loop\"/>"
            + "<SUPPLIER value=\"VZE\"/>"
            + "</HEADER>";
    RequestHandlerClient sr = null;

    try {
      String xml = FileUtils.readFile(args[0]);
      MessageProcessorContext ctx = new MessageProcessorContext();
      ctx.set("NF_HEADER_LOCATION_PROP", HEADER);
      sr = new RequestHandlerClient();
      sr.serverName = "Nightfire.Router";
      NVPair[] result = sr.process(ctx, new MessageObject((Object) xml));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }