Exemplo n.º 1
0
  protected void generate(StringToStringMap values, ToolHost toolHost, Interface modelItem)
      throws Exception {
    String wsimportDir =
        SoapUI.getSettings().getString(ToolsSettings.JBOSSWS_WSTOOLS_LOCATION, null);
    if (Tools.isEmpty(wsimportDir)) {
      UISupport.showErrorMessage(
          "JBossWS wstools/wsconsume directory must be set in global preferences");
      return;
    }

    String wsimportExtension = UISupport.isWindows() ? ".bat" : ".sh";

    File wscompileFile =
        new File(wsimportDir + File.separatorChar + "wsconsume" + wsimportExtension);
    if (!wscompileFile.exists()) {
      UISupport.showErrorMessage("Could not find wsconsume script at [" + wscompileFile + "]");
      return;
    }

    ProcessBuilder builder = new ProcessBuilder();
    ArgumentBuilder args = buildArgs(UISupport.isWindows(), modelItem);
    builder.command(args.getArgs());
    builder.directory(new File(wsimportDir));

    toolHost.run(new ProcessToolRunner(builder, "JBossWS wsconsume", modelItem));
  }
Exemplo n.º 2
0
  private ArgumentBuilder buildArgs(boolean isWindows, Interface modelItem) throws IOException {
    StringToStringMap values = dialog.getValues();
    values.put(OUTPUT, Tools.ensureDir(values.get(OUTPUT), ""));
    values.put(SOURCE_OUTPUT, Tools.ensureDir(values.get(SOURCE_OUTPUT), values.get(OUTPUT)));

    ArgumentBuilder builder = new ArgumentBuilder(values);
    builder.startScript("wsconsume");

    builder.addString(OUTPUT, "-o");
    builder.addString(CATALOG, "-c");
    builder.addString(PACKAGE, "-p");
    builder.addString(SOURCE_OUTPUT, "-s");
    builder.addString(WSDLLOCATION, "-w");
    builder.addBoolean(KEEP, "-k");
    builder.addBoolean(STACKTRACE, "-t");

    String[] bindingFiles = values.get(BINDING_FILES).split(",");
    for (String file : bindingFiles) {
      if (file.trim().length() > 0) builder.addArgs("-b", file.trim());
    }

    addToolArgs(values, builder);
    builder.addArgs(getWsdlUrl(values, modelItem));

    return builder;
  }
Exemplo n.º 3
0
  protected void generate(StringToStringMap values, ToolHost toolHost, WsdlProject project)
      throws Exception {
    String wstoolsDir =
        SoapUI.getSettings().getString(ToolsSettings.JBOSSWS_WSTOOLS_LOCATION, null);
    if (Tools.isEmpty(wstoolsDir)) {
      UISupport.showErrorMessage("wstools directory must be set in global preferences");
      return;
    }

    String wsToolsExtension = UISupport.isWindows() ? ".bat" : ".sh";

    File wstoolsFile = new File(wstoolsDir + File.separatorChar + "wstools" + wsToolsExtension);
    if (!wstoolsFile.exists()) {
      UISupport.showErrorMessage("Could not find wstools script at [" + wstoolsFile + "]");
      return;
    }

    ProcessBuilder builder = new ProcessBuilder();
    ArgumentBuilder args = buildArgs(values, UISupport.isWindows());
    builder.command(args.getArgs());
    builder.directory(new File(wstoolsDir));

    toolHost.run(
        new ToolRunner(builder, new File(values.get(OUTPUT)), values.get(SERVICE_NAME), project));
  }
Exemplo n.º 4
0
  private ArgumentBuilder buildArgs(
      StringToStringMap values, boolean isWindows, Interface modelItem) throws IOException {
    values.put(OUTPUT, Tools.ensureDir(values.get(OUTPUT), ""));

    ArgumentBuilder builder = new ArgumentBuilder(values);
    builder.startScript("wstools");

    builder.addArgs("-config", buildConfigFile(values, modelItem));
    builder.addString(OUTPUT, "-dest");
    addToolArgs(values, builder);
    return builder;
  }
Exemplo n.º 5
0
  protected void generate(StringToStringMap values, ToolHost toolHost, Interface modelItem)
      throws Exception {
    String xbDir = SoapUI.getSettings().getString(ToolsSettings.XMLBEANS_LOCATION, null);
    if (Tools.isEmpty(xbDir)) {
      UISupport.showErrorMessage("XmlBeans location must be set in global preferences");
      return;
    }

    ProcessBuilder builder = new ProcessBuilder();
    ArgumentBuilder argumentBuilder = buildArgs(values, modelItem);
    builder.command(argumentBuilder.getArgs());
    builder.directory(new File(xbDir + File.separatorChar + "bin"));

    toolHost.run(new ProcessToolRunner(builder, "XmlBeans", modelItem));
  }
Exemplo n.º 6
0
  private ArgumentBuilder buildArgs(StringToStringMap values, Interface modelItem)
      throws IOException {
    values.put(OUTPUT, Tools.ensureDir(values.get(OUTPUT), ""));

    ArgumentBuilder builder = new ArgumentBuilder(values);
    builder.addArgs("java", "-jar", "wsa.jar", "-genProxy");
    addJavaArgs(values, builder);

    builder.addArgs("-wsdl", getWsdlUrl(values, modelItem));
    builder.addString(OUTPUT, "-output");
    builder.addString(PACKAGE, "-packageName");

    addToolArgs(values, builder);
    return builder;
  }
Exemplo n.º 7
0
  protected void generate(StringToStringMap values, ToolHost toolHost, Interface modelItem)
      throws Exception {
    String wsaDir = SoapUI.getSettings().getString(ToolsSettings.ORACLE_WSA_LOCATION, null);
    if (Tools.isEmpty(wsaDir)) {
      UISupport.showErrorMessage("wsa.jar directory must be set in global preferences");
      return;
    }

    File wsaFile = new File(wsaDir + File.separatorChar + "wsa.jar");
    if (!wsaFile.exists()) {
      UISupport.showErrorMessage("Could not find wsa.jar at [" + wsaFile + "]");
      return;
    }

    ProcessBuilder builder = new ProcessBuilder();
    ArgumentBuilder args = buildArgs(values, modelItem);
    builder.command(args.getArgs());
    builder.directory(new File(wsaDir));

    toolHost.run(new ProcessToolRunner(builder, "Oracle wsa.jar", modelItem));
  }
Exemplo n.º 8
0
  private ArgumentBuilder buildArgs(StringToStringMap values, Interface modelItem) {
    ArgumentBuilder builder = new ArgumentBuilder(values);

    values.put(XSBTARGET, Tools.ensureDir(values.get(XSBTARGET), ""));
    values.put(SRCTARGET, Tools.ensureDir(values.get(SRCTARGET), ""));

    builder.startScript("scomp", ".cmd", "");

    builder.addString(XSBTARGET, "-d");
    builder.addString(SRCTARGET, "-src");
    builder.addString(JARFILE, "-out");

    builder.addBoolean(SRCONLY, "-srconly");
    builder.addBoolean(DOWNLOADS, "-dl");
    builder.addBoolean(NOUPA, "-noupa");
    builder.addBoolean(NOPVR, "-nopvr");
    builder.addBoolean(NOANN, "-noann");
    builder.addBoolean(NOVDOC, "-novdoc");
    builder.addBoolean(DEBUG, "-debug");

    builder.addString(JAVASOURCE, "-javasource");
    builder.addString(ALLOWMDEF, "-allowmdef");
    builder.addString(CATALOG, "-catalog");
    builder.addBoolean(VERBOSE, "-verbose");

    String javac = ToolsSupport.getToolLocator().getJavacLocation(false);

    if (StringUtils.hasContent(javac)) {
      builder.addArgs("-compiler", javac + File.separatorChar + "javac");
    }
    addToolArgs(values, builder);

    builder.addString(XSDCONFIG, null);
    builder.addArgs(getWsdlUrl(values, modelItem));

    return builder;
  }