Here is what I deduce re placement of class files to support java services.
-
All subordinate class files must be placed in a jar (or zip) file. One cannot import a freestanding class that does not reside in a jar/zip
-
Place the jar in the following folder to make it available server-wide (you must restart IS before the jar is recognized)
C:\webMethods6\IntegrationServer\lib\jars
- Place the jar/zip in the following folder to make it available to a given package (say JavaclassExample)
C:\webMethods6\IntegrationServer\packages\JavaclassExample\code\jars
You need not re-start IS to make the jar/zip available.
- Here is how you reference the class in various contexts.
a. JavaclassExample (package name)
javaclassExample (top level folder name)
javaFolder (second level folder name)
javaService (java service name)
b. javaFolder.MyClass (import reference)
c. String myVariable = MyClass.myMethod(“World”); (code within java svc)
d. myFolder\MyClass.class (contents of jar/zip file)
Here is my java service:
System.out.println(“starting javaService”);
String myVariable = MyClass.myMethod(“World”);
System.out.println("myMethod returned " + myVariable);
System.out.println(“stopping javaService”);
Here is my external supporting class:
import java.io.*;
import java.lang.String;
public class MyClass
{
public static String myMethod(String str)
{
System.out.println(“MyClass.myMethod started with input=” + str);
return str.toUpperCase();
}
}
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods