title: How to see SOAP request XML body on Java as a string?
body: <p>I'm debugging an old Java Android code which makes some SOAP API calls, but I'm having a hard time looking at the request body content as a string (maybe printing it to the console) so I can replicate this request on other languages.</p>
  <p>The java code looks something like this:</p>
  <pre><code>String NAMESPACE = &quot;http://tempuri.org/&quot;;
          //String URL = servidor + &quot;&quot;;
          String URL = servidor + &quot;&quot;;
  
          String METHOD_NAME = &quot;&quot;;
          String SOAP_ACTION = &quot;&quot;;
  
          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
  
          request.addProperty(&quot;key&quot;, key);
          request.addProperty(&quot;dev&quot;, dev);
          request.addProperty(&quot;mac&quot;, mac);
          request.addProperty(&quot;x&quot;, x);
          request.addProperty(&quot;y&quot;, y);
          request.addProperty(&quot;user&quot;, user);
          request.addProperty(&quot;pass&quot;, pass);
  
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envelope.dotNet = true;
  
          envelope.setOutputSoapObject(request);
          HttpTransportSE transporte = new HttpTransportSE(URL);
  </code></pre>
  <p>I've tried printing <code>request</code> and <code>envelope</code> objects as strings but it really does not shows me what I want. I'm expecting a XML string so I can replicate in other places....</p>
  <pre><code>Log.v(&quot;Karlo&quot;,envelope.toString());
  Log.v(&quot;Karlo&quot;,request.toString());
  </code></pre>