package com.seejoke.uitl;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

/**
 * webservice 第一节:如何使用webservice
 * 
 * @web www.seejoke.com
 * @author j@seejoke.com
 * @date 2014-7-28 下午05:12:21
 * @package com.seejoke.uitl
 */
public class TestClient {

	public static String url = "http://127.0.0.1/axis/services/service.jws";
	private static Service service = new Service();
	private static Call call;

	public static void main(String[] args) throws Exception {
		serviceJoke("seejoke.com");
	}

	public static void serviceJoke(String token) throws Exception {
		call = (Call) service.createCall();
		// 设置service所在URL
		call.setTargetEndpointAddress(new java.net.URL(url));
		// 指定服务提供的方法名字
		call.setOperationName("jokeService");
		// 参数 token(一些列的参数根据实际编写)
		Boolean ret = (Boolean) call.invoke(new Object[] { token });

		// 执行结果true 成功 false 失败
		System.out.println(ret);
	}
}
最近下载更多
meiyuanhaotiancai  LV5 2023年3月28日
落后就要挨打  LV26 2021年11月10日
huang_jie  LV1 2021年3月22日
zhangtian1997  LV10 2020年8月24日
大鲶鱼  LV4 2020年3月16日
我真的是小明  LV10 2019年7月16日
辉辉辉辉辉辉  LV10 2019年3月11日
wsupsup  LV16 2019年2月19日
gt2018  LV5 2018年9月12日
天天吃面  LV27 2018年7月12日
最近浏览更多
meiyuanhaotiancai  LV5 2023年3月28日
cooper1 2022年12月14日
暂无贡献等级
cibei111 2022年2月25日
暂无贡献等级
cc900118  LV17 2021年10月11日
shiopaaa  LV13 2021年8月18日
40107609  LV1 2021年7月15日
heifenglei  LV7 2021年6月9日
huang_jie  LV1 2021年3月22日
Possess  LV4 2021年3月9日
爱情戴罪的羔羊  LV7 2021年2月24日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友