Hi,
Using Developer got the java client code as below
/*
- This class has been automatically generated by the webMethods Developer™.
-
/
import java.io.;
import java.util.Vector;
import com.wm.util.Table;
import com.wm.data.;
import com.wm.util.coder.IDataCodable;
import com.wm.app.b2b.util.GenUtil;
import com.wm.app.b2b.client.Context;
import com.wm.app.b2b.client.ServiceException;
public class temp1{
public static void main(String[] args)
{
// Connect to server - edit for alternate server
String server = “XXXXXXXXXX:5555”;
Context context = new Context();
// To use SSL:
//
// context.setSecure(true);
// Optionally send authentication certificates
//
// String cert = “c:\myCerts\cert.der”;
// String privKey = “c:\myCerts\privkey.der”;
// String cacert = “c:\myCerts\cacert.der”;
// context.setSSLCertificates(cert, privKey, cacert);
// Set username and password for protected services
String username = “Administrator”;
String password = “manage”;
try {
context.connect(server, username, password);
} catch (ServiceException e) {
System.out.println(“\n\tCannot connect to server "”+server+“"”);
System.exit(0);
}
try
{
// Collect inputs (top-level only)
IData inputDocument = getInputs();
// *** Invoke the Service and Disconnect ***
IData outputDocument = invoke(context, inputDocument);
context.disconnect();
System.out.println("\n******** Successful invoke “);
// *** Access the Results ***
System.out.println(”\n*** Inputs ****“);
GenUtil.printRec(inputDocument, “Input”);
System.out.println(”\n Outputs *****************");
GenUtil.printRec(outputDocument, “Output”);
} catch (IOException e) {
System.err.println(e);
} catch (ServiceException e) {
System.err.println(e);
}
System.exit(0);
}
// *** Collect Inputs *** //
public static IData getInputs()
throws IOException, ServiceException
{
return Input_getInputs();
}
public static IData Output_getInputs()
throws IOException, ServiceException
{
IData out = IDataFactory.create();
IDataCursor idc = out.getCursor();
idc.insertAfter("str", getString("str"));
idc.destroy();
return out;
}
public static IData Input_getInputs()
throws IOException, ServiceException
{
IData out = IDataFactory.create();
IDataCursor idc = out.getCursor();
idc.insertAfter("var1", getString("var1"));
idc.insertAfter("var2", getString("var2"));
idc.destroy();
return out;
}
public static String getString(String name)
throws IOException, ServiceException
{
System.out.print(name + " =");
return (new BufferedReader(new InputStreamReader(System.in))).readLine();
}
public static String[] getStringArray(String name)
throws IOException, ServiceException
{
int size;
String tmp;
System.out.print(name + ": how large? ");
tmp = (new BufferedReader(new InputStreamReader(System.in))).readLine();
size = Integer.parseInt(tmp);
String[] strArray = new String[size];
for(int i = 0; i < size; i++){
strArray[i] = getString(name +"[" + i + "]");
}
return strArray;
}
public static String[][] getStringTable(String name)
throws IOException, ServiceException
{
int rows = 0, cols = 0;
String tmp;
System.out.print(name + ": how many rows? ");
tmp = (new BufferedReader(new InputStreamReader(System.in))).readLine();
rows = Integer.parseInt(tmp);
System.out.print(name + ": how many cols? ");
tmp = (new BufferedReader(new InputStreamReader(System.in))).readLine();
cols = Integer.parseInt(tmp);
String[][] strTable = new String[rows][cols];
for(int i = 0; i < rows; i++){
for(int j = 0; j < cols; j++){
strTable[i][j] = getString(name+"["+i+"]["+j+"]");
}
}
return strTable;
}
public static IData invoke(
Context context, IData inputDocument)
throws IOException, ServiceException
{
IData out = context.invoke("Temp", "temp1", inputDocument);
IData outputDocument = out;
return outputDocument;
}
}
Also compiled successfully, but when I tried to execute from comand prompt, throwing error as below
c:>java temp1
Exception in thread “main” java.lang.NoClassDefFoundError: javax/mail/internet/ParseException
at com.wm.util.Base64.encode(Base64.java:68)
at com.wm.app.b2b.client.BaseContext.setAuthentication(BaseContext.java:587)
at com.wm.app.b2b.client.Context.connect(Context.java:527)
at sample1.main(sample1.java:38)
Caused by: java.lang.ClassNotFoundException: javax.mail.internet.ParseException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
… 4 more
Verified the CLASSPATH & PATH
CLASSPATH=.;C:\jdk1.5.0_19\jre;C:\webMethods7\common\lib;C:\webMethods7\common\lib\ext;
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\jdk1.5.0_19;C:\jdk1.5.0_19\bin;C:\jdk1.5.0_19\lib;C:\webMethods7\common\lib;C:\webMethods7\common\lib\ext;
Am seeing “ws-isclient.jar” file not “client.jar” file (do we have any other client jar file to be included?)
Any correction please.
Regards,
Sam
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods