cfx 调用webservice方式

方式一:通过ClientProxyFactoryBean 调用

 

public static <T> T getService(String url, Class<T> cls) {
  ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
  factory.setServiceClass(cls);
  factory.setAddress(url);
  T service = (T) factory.create();
  return service;
 }

 

 

 

 

方式二:通过JaxWsDynamicClientFactory 调用

JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient("http://192.168.1.102:12000/testService?wsdl");

Object[] objects = client.invoke("test", "test args");

 

你可能感兴趣的:(webservice)