`
lihao
  • 浏览: 25586 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

java通过xfire调用webservice

 
阅读更多
导入jar文件xfire-all-1.2.4.jar,jdom-1.0.jar,commons-httpclient-3.0.jar
import java.net.MalformedURLException;
import java.net.URL;

import org.codehaus.xfire.client.Client;

public class HelloWorldClient {
	
	public static void main(String[] args) throws MalformedURLException,
			Exception {
		Client c = new Client(new URL("http://192.168.1.127:8080/TestWebService01/services/HelloWorldService?wsdl"));
		
		Object[] results = c.invoke("example", new Object[]{"44"});
		System.out.println(results[0].toString());
	}

}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics