/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplicationuncallwsdl;

import java.util.List;
import javax.xml.namespace.QName;     
import javax.xml.rpc.encoding.XMLType; 
import org.apache.axis.client.Call;  
import org.apache.axis.client.Service;

/**
 *
 * @author Luojie
 */
public class JavaApplicationUncallwsdl {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        MakeCallOnclick("7001","018681471812","122");  	
    }
    
    /**
     * @deprecated 点击拨号
     * 
     */
    public static void MakeCallOnclick(String strExten, String str_tel_num, String strActionID){ 
    try { 
        String endpoint = "http://xxx.xxx.xxx.xxx:6983/uncall_api/";   
        Service service = new Service();   
        Call call = (Call)service.createCall();   
        call.setTargetEndpointAddress(endpoint);   
        call.setOperationName(new QName("urn:Uncall", "OnClickCall"));
        call.addParameter("strExten", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
        call.addParameter("strToTel", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
        call.addParameter("strActionID", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
        call.setReturnType(XMLType.XSD_STRING);
        call.setUseSOAPAction( true );
        String result = (String)call.invoke(new Object[]{strExten,str_tel_num,strActionID});
        System.out.println("response:"+result);
        if(result.equals("0")){
            List Values = call.getOutputValues(); 
            System.out.println("call-id"+Values.get(0).toString());
        }  
         }
         catch (Exception e) {  
            System.out.println(e.toString());    
         }
	}     
    
}


java jar 包下载