import javax.xml.soap.*;

/**
 * An example that uses a SOAPConnection to invoke a remote method.
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class CurrencyConverterClient
{
    /**
     * The entry point of the application.
     *
     * @param args  The command line arguments (from, to, amt)
     */
    public static void main(String[] args) throws SOAPException
    {
        // Create a factory
        SOAPConnectionFactory soapConnectionFactory = 
            SOAPConnectionFactory.newInstance();

        // Create a connection
        SOAPConnection soapConnection = 
            soapConnectionFactory.createConnection();

        // Create a request
        SOAPMessage soapRequest = 
            CurrencyConverterRequestFactory.createRequest(args[0], args[1], args[2]);
        
        // Send the request and get the respons
        String soapEndpoint = "http://w3.cs.jmu.edu/currency.soap";
        
        SOAPMessage soapResponse = soapConnection.call(soapRequest,
                                                       soapEndpoint);


        // Process the response

    }
}
