we use a unix shell script that call a java class
file that has been compiled with .java that looks something like this. You can webMethods support for complete source java code.
…
…
…
Context context = new Context();
String server = null;
try
{
if (! parseParams(args, params) )
{
System.out.println("Failed to parse arguments");
System.out.println(usage);
}
server = params.get("host") + ":" + params.get("port");
username = (String) params.get("username");
password = (String) params.get("password");
if (password == null)
{
System.out.println("Password is null.");
System.out.println(usage);
System.exit(1);
}
context.connect(server, username, password);
}
catch (IndexOutOfBoundsException o)
{
System.out.println("Please make sure argument values are provided.");
System.out.println(usage);
System.exit(1);
}
catch (Exception e)
{
System.out.println("Fail to connect to " + server + " as " + username + ".");
System.out.println(e.getMessage());
System.exit(1);
}
try
{
Values v = new Values();
v.put("option", "force");
context.invoke("wm.server.admin", "shutdown", v);
context.disconnect();
}
…
…
#webMethods#webMethods-General#Integration-Server-and-ESB