Pass parameters to SOAP method
<p>I've got an app that connects to our .NET web service and I'm finding that we are creating the same method for each web service method but the only difference is the parameters and the web service method.  I'm looking for a way to have the following method accept parameters and then it could be more useful to manage 1 vs. several.</p>

<p><strong>Current Method</strong>  *NameSpace, URL, argName, argValue are all defined at the top of the class.</p>

<pre><code>public static Document GetTickets() {
    try { 
        SoapObject request = new SoapObject(NameSpace, "GetTickets");         
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;
        request.addProperty(argName, argValue);

        request.addProperty("Customer", "ABC");
        request.addProperty("Local", "USA");

        envelope.setOutputSoapObject(request);
        androidHttpTransport.call("RemoteWebService/GetTickets", envelope); 

        SoapPrimitive responseData = (SoapPrimitive) envelope.getResponse();
        if (responseData != null)
        {
            //get the factory
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            //Using factory get an instance of document builder
            DocumentBuilder db = dbf.newDocumentBuilder();
            //parse using builder to get DOM representation of the XML file
            InputSource is = new InputSource(new StringReader(responseData.toString()));
            return db.parse(is);
        }
        else
            return null;
    }
    catch (Exception e)
    {
        Errors.LogError(e);
        return null;
    }
}
</code></pre>

<p>I'd like it to be something along these lines:</p>

<pre><code>public static Document GetTickets(String WebServiceMethod, ArrayList Params) {
    try { 
        SoapObject request = new SoapObject(NameSpace, WebServiceMethod);         
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;

        //Syntax is wrong, I know, but just want to show what I'm looking to do:
        foreach(Parameter p in Params)
            request.addProperty(p[0].value, p[1].value);

        envelope.setOutputSoapObject(request);
        androidHttpTransport.call("RemoteWebService/" + WebServiceMethod, envelope); 

        SoapPrimitive responseData = (SoapPrimitive) envelope.getResponse();
        if (responseData != null)
        {
            //get the factory
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            //Using factory get an instance of document builder
            DocumentBuilder db = dbf.newDocumentBuilder();
            //parse using builder to get DOM representation of the XML file
            InputSource is = new InputSource(new StringReader(responseData.toString()));
            return db.parse(is);
        }
        else
            return null;
    }
    catch (Exception e)
    {
        Errors.LogError(e);
        return null;
    }
}
</code></pre>

<p>I've tried a couple of different attempts at this but getting lots of errors.  I know it's rather simple but can't seem to figure it out atm.</p>
