title: Unable to recieve parameters from Webservice using KSOAP2 in android
body: <p>I am developing an Android client for ideone.com web service. This Web service enable you to execute code in various languages on an online web server and get the output of code you executed. Address of the WSDL for this Web service is:</p>
  
  <p><a href="http://ideone.com/api/1/service.wsdl" rel="nofollow">http://ideone.com/api/1/service.wsdl</a></p>
  
  <p>I am using KSOAP2.4 for communicating with the Web service through an Android application. But i am not receiving the response properly from the Web service. The response i am receiving from the web service contains null values for last four parameters. Here is the code i used to invoke the Web service:</p>
  
  <pre><code>public IdeoneSubmissionDetails getSubmissionDetails(String link,
          Boolean withSource, Boolean withInput, Boolean withOutput,
          Boolean withStderr, Boolean withCmpinfo) {
  
      IdeoneSubmissionDetails ret = null;
      Hashtable&lt;String, Object&gt; data = new Hashtable&lt;String, Object&gt;();
  
      try {
          SoapObject request = new SoapObject(NAMESPACE,"getSubmissionDetails");
          request.addProperty("user", "ashwanikumar");
          request.addProperty("pass", "13@silvi");
          request.addProperty("link", link);
          request.addProperty("withSource", withSource);
          request.addProperty("withInput", withInput);
          request.addProperty("withOutput", withOutput);
          request.addProperty("withStderr", withStderr);
          request.addProperty("withCmpinfo", withCmpinfo);
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                  SoapEnvelope.VER11);
          envelope.setOutputSoapObject(request);
          HttpTransportSE transport = new HttpTransportSE(URL);
          transport.debug = true;
          transport.call(SOAP_ACTION + "getSubmissionDetails", envelope);
          SoapObject so = (SoapObject) envelope.bodyIn;
          SoapObject so2 = (SoapObject) so.getProperty(0);
          int count = so2.getPropertyCount();
          for (int i = 0; i &lt; count; ++i) {
              SoapObject so4 = (SoapObject) so2.getProperty(i);
              String key = so4.getProperty(0).toString();
              Log.i("Key", key);
              Object val = so4.getProperty(1);
              Log.i("Object",val.toString());
              data.put(key, val);
          }
  
          String error = (String) data.get("error");
          if (!error.equals("OK")) {
              System.out.println("Error occurred: " + error);
              return null;
          }
  
          ret = new IdeoneSubmissionDetails();
          ret.langId = (Integer) data.get("result");
          ret.langName = (String) data.get("langName");
          ret.langVersion = (String) data.get("langVersion");
          ret.date = (String) data.get("date");
          ret.time = Float.valueOf(((SoapPrimitive) data.get("time"))
                  .toString());
          ret.result = (Integer) data.get("result");
          ret.status = (Integer) data.get("status");
          ret.memory = (Integer) data.get("memory");
          ret.signal = (Integer) data.get("signal");
          ret.isPublic = (Boolean) data.get("public");
          if (withSource.booleanValue()) {
              ret.source = (String) data.get("source");
          }
          if (withInput.booleanValue()) {
              ret.input = (String) data.get("input");
          }
          if (withOutput.booleanValue()) {
              ret.output = (String) data.get("output");
          }
          if (withStderr.booleanValue()) {
              ret.stderr = (String) data.get("stderr");
          }
          if (withCmpinfo.booleanValue()) {
              ret.cmpinfo = (String) data.get("cmpinfo");
          }
  
      } catch (IOException ex) {
          System.out.println("IO Error");
      } catch (NumberFormatException ex) {
          System.out.println("Number Format Error");
      } catch (Exception ex) {
          System.out.println("Error "+ex.toString());
      }
  
      return ret;
  }
  </code></pre>
  
  <p>In response the value of output parameter is null. In case, of any error the Stderr will return the error information. on successful execution of the code the output parameter should contain the output of code you executed.
  To check the execution of the Web service is used SOAPUI. Here is the request that i used to submit the code on the web service:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://ideone.com/api/1/service"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;ser:createSubmission soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
           &lt;user xsi:type="xsd:string"&gt;ashwanikumar&lt;/user&gt;
           &lt;pass xsi:type="xsd:string"&gt;13@silvi&lt;/pass&gt;
           &lt;sourceCode xsi:type="xsd:string"&gt;class Main{public static void main (String[] args){    System.out.println("Hello");}}&lt;/sourceCode&gt;
           &lt;language xsi:type="xsd:int"&gt;10&lt;/language&gt;
           &lt;input xsi:type="xsd:string"&gt;&lt;/input&gt;
           &lt;run xsi:type="xsd:boolean"&gt;true&lt;/run&gt;
           &lt;private xsi:type="xsd:boolean"&gt;false&lt;/private&gt;
        &lt;/ser:createSubmission&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>The response i received from the web service is:</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ideone.com/api/1/service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;
     &lt;SOAP-ENV:Body&gt;
        &lt;ns1:createSubmissionResponse&gt;
           &lt;return xsi:type="ns2:Map"&gt;
              &lt;item&gt;
                 &lt;key xsi:type="xsd:string"&gt;error&lt;/key&gt;
                 &lt;value xsi:type="xsd:string"&gt;OK&lt;/value&gt;
              &lt;/item&gt;
              &lt;item&gt;
                 &lt;key xsi:type="xsd:string"&gt;link&lt;/key&gt;
                 &lt;value xsi:type="xsd:string"&gt;8GaBJ&lt;/value&gt;
              &lt;/item&gt;
           &lt;/return&gt;
        &lt;/ns1:createSubmissionResponse&gt;
     &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>The preceding request specifies that the code has been submitted successfully and you can access it using the link </p>
  
  <p><a href="http://ideone.com/8GaBJ" rel="nofollow">http://ideone.com/8GaBJ</a></p>
  
  <p>The parameter 8GaBJ specifies the ID for the submission i created and is used to reference the submission later.
  The second request i created to execute the submission details, this is the method which is returning improper response when invoked using KSOAP2 android client. Here is the code:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://ideone.com/api/1/service"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;ser:getSubmissionDetails soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
           &lt;user xsi:type="xsd:string"&gt;ashwanikumar&lt;/user&gt;
           &lt;pass xsi:type="xsd:string"&gt;13@silvi&lt;/pass&gt;
           &lt;link xsi:type="xsd:string"&gt;8GaBJ&lt;/link&gt;
           &lt;withSource xsi:type="xsd:boolean"&gt;TRUE&lt;/withSource&gt;
           &lt;withInput xsi:type="xsd:boolean"&gt;TRUE&lt;/withInput&gt;
           &lt;withOutput xsi:type="xsd:boolean"&gt;TRUE&lt;/withOutput&gt;
           &lt;withStderr xsi:type="xsd:boolean"&gt;TRUE&lt;/withStderr&gt;
           &lt;withCmpinfo xsi:type="xsd:boolean"&gt;TRUE&lt;/withCmpinfo&gt;
        &lt;/ser:getSubmissionDetails&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>The response is received is:</p>
  
  <pre><code>&lt;SOAP-ENV:Body&gt;
            &lt;ns1:getSubmissionDetailsResponse&gt;
               &lt;return xsi:type="ns2:Map"&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;error&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"&gt;OK&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;langId&lt;/key&gt;
                     &lt;value xsi:type="xsd:int"&gt;10&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;langName&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"&gt;Java&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;langVersion&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"&gt;sun-jdk-1.6.0.31&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;time&lt;/key&gt;
                     &lt;value xsi:type="xsd:float"&gt;0.03&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;date&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"&gt;2012-03-29 07:30:29&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;status&lt;/key&gt;
                     &lt;value xsi:type="xsd:int"&gt;0&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;result&lt;/key&gt;
                     &lt;value xsi:type="xsd:int"&gt;15&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;memory&lt;/key&gt;
                     &lt;value xsi:type="xsd:int"&gt;245632&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;signal&lt;/key&gt;
                     &lt;value xsi:type="xsd:int"&gt;0&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;public&lt;/key&gt;
                     &lt;value xsi:type="xsd:boolean"&gt;true&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;source&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"&gt;class Main{public static void main (String[] args){    System.out.println("Hello");}}&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;input&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"/&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;output&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"&gt;Hello&lt;/value&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;stderr&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"/&gt;
                  &lt;/item&gt;
                  &lt;item&gt;
                     &lt;key xsi:type="xsd:string"&gt;cmpinfo&lt;/key&gt;
                     &lt;value xsi:type="xsd:string"/&gt;
                  &lt;/item&gt;
               &lt;/return&gt;
            &lt;/ns1:getSubmissionDetailsResponse&gt;
         &lt;/SOAP-ENV:Body&gt;
  </code></pre>
  
  <p>Note that the values of the following items is correct</p>
  
  <pre><code>&lt;item&gt;
  
  
   &lt;key xsi:type="xsd:string"&gt;input&lt;/key&gt;
             &lt;value xsi:type="xsd:string"/&gt;
          &lt;/item&gt;
          &lt;item&gt;
             &lt;key xsi:type="xsd:string"&gt;output&lt;/key&gt;
             &lt;value xsi:type="xsd:string"&gt;Hello&lt;/value&gt;
          &lt;/item&gt;
          &lt;item&gt;
             &lt;key xsi:type="xsd:string"&gt;stderr&lt;/key&gt;
             &lt;value xsi:type="xsd:string"/&gt;
          &lt;/item&gt;
          &lt;item&gt;
             &lt;key xsi:type="xsd:string"&gt;cmpinfo&lt;/key&gt;
             &lt;value xsi:type="xsd:string"/&gt;
          &lt;/item&gt;
  </code></pre>
  
  <p>but if i look at the response i received in Android tell me a completely different story. </p>
  
  <pre><code> itemType{key="output" value=}
  </code></pre>
  
  <p>this is what i receive from the web service in response. But instead of this i should receive:</p>
  
  <pre><code> itemType{key="output" value=&lt;Output_text&gt;}
  </code></pre>
  
  <p>Please help me identifying the problem.</p>