title: How can you remove namespace declarations in ksoap?
body: <p>Right off the bat, here is my Soap call implementation, minus the irrelevant bits.</p>
  
  <pre><code>public class MySoapClient implements AbstractSoapClient
  {
  
      private String NAMESPACE = "http://www.examples.com/wsdl/MyService/";
      private String METHOD_NAME = "getPersonDetails";
      private String SOAP_ACTION = "http://www.examples.com/getPersonDetails/";
      String URL = "http://192.168.0.10:8088/mockMyServiceBinding?WSDL";
  
  
      public Object process() throws Exception
      {
          SoapSerializationEnvelope envelope = generateEnvelope();
          return responseObject = makeCall(envelope);
      }
  
      private SoapSerializationEnvelope generateEnvelope()
      {
          // dont set a namespace for the requestobject, otherwise ksoap adds implicit namespaces onto request elements
          SoapObject requestObject = new SoapObject("", METHOD_NAME);
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envelope.dotNet = true;
          envelope.implicitTypes = true;
  
          requestObject.addProperty("name", "Dave");
          envelope.setOutputSoapObject(requestObject);
  
          return envelope;
      }
  
      private Object makeCall(SoapSerializationEnvelope envelope)
      {
          HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
          try
          {
              androidHttpTransport.debug = true;
              androidHttpTransport.call(SOAP_ACTION, envelope);
              return envelope.bodyIn;
          }
          catch (Exception e)
          {
              e.printStackTrace();
              return e;
          }
      }
  
  
  }
  </code></pre>
  
  <p>I think the problem is the <code>SoapObject requestObject = new SoapObject("", METHOD_NAME);</code> part.</p>
  
  <p>If I use <code>SoapObject requestObject = new SoapObject("", METHOD_NAME);</code> Then I get this in the bodyOut :</p>
  
  <pre><code>&lt;v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema"
              xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;v:Header/&gt;
      &lt;v:Body&gt;
          &lt;getPersonDetails xmlns="" id="o0" c:root="1"&gt;
              &lt;name&gt;Dave&lt;/name&gt;
          &lt;/getPersonDetails&gt;
      &lt;/v:Body&gt;
  &lt;/v:Envelope&gt;
  </code></pre>
  
  <p>If I use <code>SoapObject requestObject = new SoapObject(NAMESPACE, METHOD_NAME);</code> Then I get this in the bodyOut :</p>
  
  <pre><code>&lt;v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema"
              xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;v:Header/&gt;
      &lt;v:Body&gt;
          &lt;n0:getPersonDetails id="o0" c:root="1" xmlns:n0="http://www.examples.com/wsdl/MyService/"&gt;
              &lt;name i:type="d:string"&gt;Dave&lt;/name&gt;
          &lt;/n0:getPersonDetails&gt;
      &lt;/v:Body&gt;
  &lt;/v:Envelope&gt;
  </code></pre>
  
  <p>BUT..SoapUI only accepts the following as a valid XML request :</p>
  
  <pre><code>&lt;v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema"
              xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;v:Header/&gt;
      &lt;v:Body&gt;
          &lt;getPersonDetails&gt;
              &lt;name&gt;Dave&lt;/name&gt;
          &lt;/getPersonDetails&gt;
      &lt;/v:Body&gt;
  &lt;/v:Envelope&gt;
  </code></pre>
  
  <p>For some reason, it doesn't like the <code>xmlns="http://www.examples.com/getPersonDetails/" id="o0" c:root="1"</code> part, but I can't find a way to remove it, please help!</p>
  
  <p>So how can I completely remove the xmlns declaration? It feels "dirty" creating a SoapObject and setting namespace to ""</p>