forked from demo/example
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
51 lines
1.5 KiB
7 years ago
|
package com.fr.data;
|
||
|
|
||
6 years ago
|
import javax.xml.namespace.QName;
|
||
7 years ago
|
import org.apache.axis.client.Call;
|
||
|
import org.apache.axis.client.Service;
|
||
6 years ago
|
import com.fr.data.AbstractTableData;
|
||
|
import com.fr.general.data.TableDataException;
|
||
7 years ago
|
|
||
6 years ago
|
public class WebServiceTableData extends AbstractTableData{
|
||
7 years ago
|
private String[][] data;
|
||
|
|
||
|
public WebServiceTableData() {
|
||
6 years ago
|
this.data = this.createData();
|
||
7 years ago
|
}
|
||
|
|
||
|
//获取列数
|
||
|
public int getColumnCount() throws TableDataException {
|
||
|
return data[0].length;
|
||
|
}
|
||
|
|
||
|
//获取列的名称为数组中第一行的值
|
||
|
public String getColumnName(int columnIndex) throws TableDataException {
|
||
|
return data[0][columnIndex];
|
||
|
}
|
||
|
|
||
|
//获取行数为数据的长度-1
|
||
|
public int getRowCount() throws TableDataException {
|
||
|
return data.length - 1;
|
||
|
}
|
||
|
|
||
|
//获取值
|
||
|
public Object getValueAt(int rowIndex, int columnIndex) {
|
||
|
return data[rowIndex + 1][columnIndex];
|
||
|
}
|
||
|
|
||
6 years ago
|
public String[][] createData() {
|
||
7 years ago
|
try {
|
||
|
String endpoint = "http://localhost:8080/axis/TestWS2TDClient.jws";
|
||
|
Service service = new Service();
|
||
|
Call call = (Call) service.createCall();
|
||
|
call.setTargetEndpointAddress(new java.net.URL(endpoint));
|
||
|
call.setOperationName(new QName("http://localhost:8080/axis/TestWS2TDClient.jws",
|
||
|
"getTD"));
|
||
6 years ago
|
String[][] ret = (String[][])call.invoke(new Object[] {});
|
||
|
return ret;
|
||
7 years ago
|
} catch (Exception e) {
|
||
|
e.printStackTrace();
|
||
|
}
|
||
6 years ago
|
return new String[][] {};
|
||
7 years ago
|
}
|
||
|
}
|