axis2客户端jar包

package com.anihc.demo.axis2Client;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;

import org.apache.axis2.rpc.client.RPCServiceClient;

public class RPCClient {
/**
*
* @param target wsdl地址
* @param method 调用的方法名称
* @param namespace wsdl命名空间
* @param opAddEntryArgs 调用方法的传入参数
* @param classes 调用方法的返回值类型
* @return
* @throws AxisFault
*/
@SuppressWarnings(“unchecked”)
public Object[] doit(String target,String method,String namespace,Object[] opAddEntryArgs,Class[] classes) throws AxisFault{
RPCServiceClient client=new RPCServiceClient();
Options options=client.getOptions();
EndpointReference targetepr=new EndpointReference(target);
options.setTo(targetepr);
//Object[] opAddEntryArgs=new Object[]{};
//Class[] classes=new Class[]{String.class};
QName opAddEntry =new QName(namespace,method);
return client.invokeBlocking(opAddEntry, opAddEntryArgs, classes);
}
public static void main(String[] args) throws Exception{
String target=”http://127.0.0.1:8080/w1/services/helloworld?wsdl”;
target=”http://127.0.0.1:8080/cxfdemo/services/HelloWorld?wsdl”;
Object[] r=new RPCClient().doit(target, “sayHi”, “http://demo.anihc.com”,new Object[]{“anihc”},new Class[] {String.class});
System.out.println(r[0].toString());
}
}

cxf整合spring发布到jboss5.1

cxf官网 http://cxf.apache.org/docs/overview.html
发布到jboss5时将beans.xml改为alpha-beans.xml