日期:2014-05-20 浏览次数:20880 次
package com.dataExchange.webserviceClient; import java.net.URL; import org.codehaus.xfire.client.Client; public class GetLogListServiceClient { public static void main(String[] args) throws Exception{ System.out.println(new GetLogListServiceClient().getLogList()); } public Object getLogList() throws Exception { Client client = new Client(new URL("http://192.168.1.6:8080/DataExchange2/services/XmlDataProvider?wsdl")); Object[] paraArr = new Object[]{1}; Object[] results = client.invoke("updateLogDispEntries", paraArr); return (Object)results[0]; } }
Service serviceModel = new ObjectServiceFactory().create(XmlDataProvider.class); XmlDataProvider service = (XmlDataProvider) new XFireProxyFactory().create(serviceModel,"http://localhost:8080/Test/services/XmlDataProvider"); List<String> list = service.getList();