CXF XFire 利用client动态调用webservice

CXF

String[] paras = {"AAA"};

JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();

Client client = dcf.createClient(WSDL);

Object[] results = client.invoke(方法名, paras);

for (Object obj : results) {

    System.out.println(obj);

}

 

Xfire

String[] paras = {"AAA"};

org.codehaus.xfire.client.Client client = 

new org.codehaus.xfire.client.Client(new URL(WSDL));

Object[] results = client.invoke(方法名, paras);

for (Object obj : results) {

System.out.println(obj);

}

你可能感兴趣的:(webservice)