axis
初学webservice,按照例子做一个webservice,在执行测试程序的时候提示:Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogF
actory
编译又没得问题,不知怎么回事,请高手赐教。
示例代码:
网上的一个例子。
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import java.net.MalformedURLException;
import java.rmi.RemoteException;
public class SayHelloClient2
{
public static void main(String[] args)
{
try
{
String endpoint =
"http://localhost/axis/HelloClient.jws";
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
call.setOperationName(new QName(
"http://localhost/axis/HelloClient.jws",
"getName"));
call.setTargetEndpointAddress
(new java.net.URL(endpoint));
String ret = (String) call.invoke(new Object[]
{"zhangsan"});
System.out.println("return value is " + ret);
System.out.println(endpoint);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
}