title: Setting a parameter for a KSOAP SOAP object (android)
body: <p>My webservice method does not seem to recognize my set parameters on the Property Info object. </p>
  
  <p>Im doing this:</p>
  
  <pre><code>public class WebService {
  //Namespace of the Webservice - can be found in WSDL
  private static String NAMESPACE = "http://service.marcusjacobsson.com/";
  //Webservice URL - WSDL File location    
  private static String URL = "http://192.168.1.139:8080/WebServiceProject/HelloWebService?wsdl";
  //SOAP Action URI again Namespace + Web method name
  private static String SOAP_ACTION = "http://service.marcusjacobsson.com/";
  
  public static String invokeHelloWorldWS(String name, String webMethName) {
      String resTxt = null;
      // Create request
      SoapObject request = new SoapObject(NAMESPACE, webMethName);
      // Property which holds input parameters
      PropertyInfo sayHelloPI = new PropertyInfo();
      // Set Name
      sayHelloPI.setName("name");
      // Set Value
      sayHelloPI.setValue(name);       
      // Set dataType
      sayHelloPI.setType(String.class);
      // Add the property to request object
      request.addProperty(sayHelloPI);
      // Create envelope
      SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
              SoapEnvelope.VER11);
      // Set output SOAP object
      envelope.setOutputSoapObject(request);
      // Create HTTP call object
      HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
  
      try {
          // Invoke web service
          androidHttpTransport.call(SOAP_ACTION+webMethName, envelope);
          // Get the response
          SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
          // Assign it to resTxt variable static variable
          resTxt = response.toString();
  
      } catch (Exception e) {
          //Print error
          e.printStackTrace();
          //Assign error message to resTxt
          resTxt = "Error occured";
      } 
      //Return resTxt to calling object
      return resTxt;
  }   
  
  }
  </code></pre>
  
  <p>So when invokeHelloWorldWS() gets called i have defined a name set by the application and a web method name. </p>
  
  <p>webservice:</p>
  
  <pre><code>@WebService
  public class HelloWeb {
  
  @WebMethod
  public String sayGreeting(String name) {
  
      return "Greeting " + name + "!";
  
  }
  
  @WebMethod
  public String testMethod(String parameter){
      return "Your parameter was: " + parameter;
  }
  
  }
  </code></pre>
  
  <p>This is the response from the webservice:</p>
  
  <p>Greeting null!</p>
  
  <p>Why isn't my parameters getting passed along with my soap?</p>