ITeye博客

简单的Axis客户端

qingzuochen · 2010-10-15 15:39 · web service · 编程语言 · Markdown

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


public class Test {

	/**
	 * 
	 * @param args
	 *            void
	 */

	public static void main(String[] args) {

		try {
			Integer reqFlag = new Integer(1);
			String provinceCode = "1";
			String cardSN = "1";
			String data = "1";
			String endpoint = "http://localhost:8099/SecrKeyMS/services/Consume";
			String operation = "service";
			Service service = new Service();
			Call call = (Call) service.createCall();
			call.setTargetEndpointAddress(new java.net.URL(endpoint));
			call.setOperationName(operation);
			String xml = (String) call.invoke(new Object[] {reqFlag,provinceCode,cardSN,data});
			System.out.println(xml);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。