当前位置: 代码迷 >> Web前端 >> axis2 客户端例证
  详细解决方案

axis2 客户端例证

热度:222   发布时间:2012-08-26 16:48:06.0
axis2 客户端例子
generate client

1. run command

wsdl2java -uri http://localhost:8080/axis2/services/MyService?wsdl -p client -s -o stub

2. copy it to eclipse

import javax.xml.namespace.QName;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
import client.MyServiceStub;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		try{
		MyServiceStub stub = new MyServiceStub();
		MyServiceStub.GetName gg = new MyServiceStub.GetName();
	    gg.setName("jack");
        System.out.println( stub.getName(gg).get_return());
		}catch(Exception x){
			System.out.println(x.getMessage());
		}
        

	}

}

  相关解决方案