您的位置:首页 > 运维架构 > Shell

虚拟机上安装完成redhat后无法上网和Xshell无法连接虚拟机的问题

2015-09-09 22:18 891 查看
axis1 客户端调用需要一个调用类,四个jar包,如果web调用需要配置CLASSPATH=.;D:\Program Files\apache-tomcat-6.0.20\lib\axis-1.4.jar;D:\Program Files\apache-tomcat-6.0.20\lib\jaxrpc.jar 和JAVA_HOME

package com.chinafung.client;

import java.net.MalformedURLException;
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;

/**
* axis1 客户端方式调用webservice
*/
public class CopyOfAxisClient {
private String wdl="http://localhost:8080/GoodsWebService/services/goodsService";
private static Service service;
private Call call;
public static synchronized Service getService()
{
if(service==null)
service=new Service();
return service;

}
public Call getCall()
{
try
{
call=(Call)getService().createCall();
call.setTargetEndpointAddress(new java.net.URL(this.wdl));
call.setOperationName(new QName("http://www.chinafung.com", "ordersService"));
call.setPassword("123");
call.setUsername("123");

return call;
} catch (MalformedURLException e) {
e.printStackTrace();

} catch (ServiceException e) {

e.printStackTrace();
}
return null;
}
public void process()
{
try
{
String str="{\"type\":\"success\"}";
getCall().invoke(new Object[]{str});
} catch (RemoteException e) {
e.printStackTrace();
}
}
public static void main(String args[])
{
CopyOfAxisClient ac=new CopyOfAxisClient();
ac.process();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: