/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package netukar.axis; import java.net.MalformedURLException; import java.rmi.RemoteException; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; import javax.xml.rpc.encoding.XMLType; import org.apache.axis.AxisFault; import org.apache.axis.client.Call; import org.apache.axis.constants.Style; import org.apache.axis.constants.Use; /** * * @author radovan */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { try { Call call = new Call("http://localhost:8080/piggybank/soap/account"); call.setOperationStyle(Style.RPC); call.setOperationUse(Use.LITERAL); call.setOperationName(new QName("piggybank", "deposit")); call.addParameter("amount", new QName("amount"), Double.class, ParameterMode.IN); call.setReturnType(XMLType.XSD_DOUBLE); Double result = (Double) call.invoke(new Object[] {new Double(1000)}); System.out.println("Operation done. Current balance: " + result); } catch (AxisFault ex) { throw new RuntimeException(ex); } catch (MalformedURLException ex) { throw new RuntimeException(ex); } catch (RemoteException ex) { throw new RuntimeException(ex); } } }