关于的axis问题
sxd78 2006-11-23 09:49:58 javac -classpath "D:\lib\axis.jar;D:\lib\jaxrpc.jar;" ServiceClient.java
编译没问题,可一运行 java ServiceClient;就提示“
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/clien
t/Service
at ServiceClient.invokeFunction(ServiceClient.java:74)
at ServiceClient.syncOrderRelation(ServiceClient.java:13)
at ServiceClient.main(ServiceClient.java:95)”
请高手多多指点!!
代码如下:
import java.rmi.RemoteException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class ServiceClient {
public int syncOrderRelation(String MSISDN, String SPID, String ServiceID,
Integer Action, String UpdateTime, String UpdateDesc,
String terminalID, String serviceEndPoint) throws Exception {
Object result=null;
try {
Call call = this.invokeFunction("syncOrderRelation",
serviceEndPoint);
result=call.invoke(new Object[] { MSISDN, SPID, ServiceID, Action,
UpdateTime, UpdateDesc, terminalID });
} catch (Exception e) {
throw e;
}
try{
return ((Integer)result).intValue();
}catch(Exception e){
return Integer.parseInt(((String)result));
}
}
public int syncContent(String contentID, String CPID, String serviceCode, String SPID,String contentName,
String contentDesc, String contentURL, String startTime,
String endTime, Integer contentType, Integer price, Integer action,String otherInfo,
String serviceEndPoint)throws Exception{
Integer result=null;
try {
Call call = this.invokeFunction("syncContent", serviceEndPoint);
result=(Integer)call.invoke(new Object[] { contentID, CPID, serviceCode,SPID,contentName,
contentDesc, contentURL, startTime, endTime, contentType,
price, action,otherInfo});
} catch (Exception e) {
throw e;
}
return result.intValue();
}
public int SMPUseContent(String contentID, String serviceCode,
String MSISDN, String serviceEndPoint)throws Exception{
Integer result=null;
try {
Call call = this.invokeFunction("SMPUseContent", serviceEndPoint);
result=(Integer)call.invoke(new Object[] { contentID, serviceCode, MSISDN });
} catch (Exception e) {
throw e;
}
return result.intValue();
}
public int syncTerminal(String terminalID, String manufacture,
String mode, String screenSize, Integer language,
Byte serviceSupport, String version, Integer memory,
String updateDate, Integer action, String serviceEndPoint)throws Exception{
Integer result=null;
try {
Call call = this.invokeFunction("syncTerminal", serviceEndPoint);
result=(Integer)call.invoke(new Object[] { terminalID, manufacture, mode,
screenSize, language, serviceSupport, version, memory,
updateDate, action });
} catch (Exception e) {
throw e;
}
return result.intValue();
}
public Call invokeFunction(String operationName, String serviceEndPoint)
throws ServiceException {
//Service service = new Service(); //Service service = new Service();
Service service =new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(serviceEndPoint);
call.setOperationName(new QName(operationName));//设置需要调用的函数名称
return call;
}
/**
* test the client method of the class
*/
public static void main(String[] args) {
ServiceClient sc = new ServiceClient();
String endPoint = "http://127.0.0.1:8008/";
try {
// int i=sc.syncOrderRelation("13009131735", "52075", "BLANTIAN", new Integer(1), "20060927120000",
// "desc","",endPoint);
int i=sc.syncOrderRelation("13304301824", "3043152104", "813701", new Integer(1), "20060926120000",
"desc","9",endPoint);
System.out.println("result ---------------"+i);
} catch (Exception e) {
e.printStackTrace();
}
}
}