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());
}

}

你可能感兴趣的:(Java,webservice)