---
title: "AXIS1.4客户端调用"
author: "fireflylover"
date: "2011-10-24T16:23:06Z"
tags: []
categories: ["Web前端"]
slug: "axis1-4"
draft: false
lastmod: "2011-10-24T16:23:46Z"
id: 1211393
url: "https://fireflylover.iteye.com/blog/1211393"
---

```
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 AxisTest {
	
	public static void main(String[] args) {
		String url = "http://192.168.0.2/dcUIService/services/DocumentService?wsdl";
		Service se = new Service();
		
		try {
			Call call = (Call) se.createCall();
			call.setTargetEndpointAddress(url);
			call.setUsername("admin");
			call.setPassword("password");
			call.setOperationName(new QName(url,"queryDocumentList"));
			try {	String result = (String) call.invoke(new Object[]{"11","bb",50});
				System.out.println("result: " + result);
			} catch (RemoteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
}
```