package com.service;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class test2 {
 public static void main(String args[]){ 	
         String helloURL = "http://localhost:8889//services/HrmService";
         try {
             //以下都是套路 
             Service service = new Service();
             Call call = (Call)service.createCall();
             call.setTargetEndpointAddress(helloURL);
             call.setOperationName("checkUser");//WSDL里面描述的接口名称
             call.addParameter("in0", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
             call.addParameter("in1", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
             call.addParameter("in2", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
             
             call.setReturnType(org.apache.axis.encoding.XMLType.XSD_BOOLEAN);//设置返回类型  
            
             //给方法传递参数,并且调用方法
             Object result = call.invoke(new String[]{"127.0.0.1","ywy","1"});
             System.out.println((Boolean)result);
             
          } catch (Exception e) {
              e.printStackTrace();
          }
          
	 } 
}
  •  注意:url不能带wsdl,否则会报错

相关文章:

  • 2021-09-23
  • 2022-01-18
  • 2021-12-29
  • 2022-02-11
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2022-12-23
  • 2021-05-22
  • 2021-12-07
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案