1、首先准备jar包:
2、代码调用如下:
String url="url地址"; QName qName=new QName("命名空间","接口名称"); Service service = new Service(); Call call; call = (Call) service.createCall(); call.setTargetEndpointAddress(url); call.setOperationName(qName);//WSDL里面描述的接口名称 call.addParameter("arg0", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数1 call.addParameter("arg1", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数2 call.addParameter("arg2", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数3 call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//设置返回类型 String result = (String)call.invoke(new Object[]{"参数1","参数2","参数3"});