用java客户端调用webservice

xfire方式:

方法一:

Client client = new Client(new URL("http://localhost:8080/myWebService/services/MyService?wsdl"));
   Object[] result = client.invoke("account", new Object[]{new Integer(3),new Integer(4)});

 

cxf方式:

方式一:

String url = "";

DynamicClientFactory dynamicClientFactory=DynamicClientFactory.newInstance();
dynamicClientFactory.setSimpleBindingEnabled(false);//如果调用非java代码的webservice时,需要设置
Client client=dynamicClientFactory.createClient(url);

Object[] resultObj = client.invoke("webCionAdd",new Object[]{account,orderid,paypoint,mechantId,userip,sign});

你可能感兴趣的:(java,webservice,object,String,Integer,url)