Hi experts, I get this error when I try to execute a java file. Thanks
D:\DS\dsSoapLab>java gmit.CalcClient
Exception in thread "main" java.lang.NoClassDefFoundE
rror: org/apache/axis/utils
/Options
at gmit.CalcClient.main(CalcC
lient.java
:12)
the java file:
package gmit;
import org.apache.axis.client.Cal
l;
import org.apache.axis.client.Ser
vice;
import org.apache.axis.encoding.X
MLType;
import org.apache.axis.utils.Opti
ons;
import javax.xml.rpc.ParameterMod
e;
public class CalcClient{
public static void main(String [] args) throws Exception{
Options options = new Options(args);
String endpoint = "
http://localhost:8080/axis/Calculator.jws";
// Do argument checking
args = options.getRemainingArgs()
;
if (args == null || args.length != 3){
System.err.println("Usage:
CalcClient <add|subtract arg1 arg2");
return;
}
String method = args[0];
if (!(method.equals("add") || method.equals("subtract"))
) {
System.err.println("Usage:
CalcClient <add|subtract arg1 arg2");
return;
}
// Make the call
Integer i1 = new Integer(args[1]);
Integer i2 = new Integer(args[2]);
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddr
ess(new java.net.URL(endpoint));
call.setOperationName( method );
call.addParameter("op1", XMLType.XSD_INT, ParameterMode.IN);
call.addParameter("op2", XMLType.XSD_INT, ParameterMode.IN);
call.setReturnType(XMLType
.XSD_INT);
Integer ret = (Integer) call.invoke( new Object [] { i1, i2 });
System.out.println("Got result : " + ret);
}
}