/**
 * @(#)CaclClient.java
 * 
 * JFoxSOAF, Service-Oriented Application Framework
 * 
 * Copyright(c) JFoxSOAF Team
 * 
 * Licensed under the GNU LGPL, Version 2.1 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at  
 * 
 * http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 * 
 * For more information, please visit:
 * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
 * http://www.huihoo.org/jfox/jfoxsoaf
 */

package org.huihoo.jfox.soaf.samples.axis;

import javax.xml.namespace.QName;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

/**
 * <p>
 * Cacl Client.
 * </p>
 * 
 * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
 * @version $Revision:$ $Date:$
 * @version Revision: 1.0
 */

public class CaclClient {

	public static void main(String[] args) {
		CaclClient cc = new CaclClient();
		cc.cacl();
	}

	public void cacl() {

		try {
			String endpoint = "http://localhost:8080/jfoxsoafaxis/services/cacl";

			Service service = new Service();
			Call call = (Call) service.createCall();

			call.setTargetEndpointAddress(new java.net.URL(endpoint));
			call.setOperationName(new QName("urn:huihoo.org", "add"));

			Integer ret = (Integer) call.invoke(new Object[] { new Integer(1),
					new Integer(1) });

			System.out.println("Sent '1+1', Got '" + ret + "'");
		} catch (Exception e) {
			System.err.println(e.toString());
		}
	}
}