title: org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:1 in Android KSOAP2, but in C# it's working
body: <p>I've been experiencing this error for 2 weeks already when accessing the WCF (.svc) Web Service. But in C# when I added the web service as service reference, it works.</p>
  
  <pre><code>org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:1 in     java.io.InputStreamReader@418188c0)
  </code></pre>
  
  <p>The Web Service's <code>targetNamespace=""urn:data.link.abc"</code> and the method's details is</p>
  
  <pre><code>&lt;wsdl:operation name="EncryptPassword"&gt;
  &lt;wsdl:input wsaw:Action="EncryptPassword" name="EncryptPasswordRequest" message="tns:EncryptPasswordRequest"/&gt;
  &lt;wsdl:output wsaw:Action="urn:data.link.abc/ABCContract/EncryptPasswordResponse"     name="EncryptPasswordReply" message="tns:EncryptPasswordReply"/&gt;
  &lt;/wsdl:operation&gt;
  </code></pre>
  
  <p>This is my code for accessing the .svc web service.</p>
  
  <pre><code>public final String web_serviceEncryptPassword(String password)
  {
      String NAMESPACE = "urn:data.link.abc";
      String METHOD_NAME = "EncryptPassword";
      String SOAP_ACTION =  NAMESPACE + "/" + "EncryptPassword";
      String URL = "http://192.168.20.254:8081/Service.svc"; //"http://192.168.20.254:8081/Service.svc?wsdl";
  
      SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
      envelope.dotNet = true;
      HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
      Object result = null;
      try
      {
          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
          //request.addProperty("_Password", password);
          PropertyInfo propertyInfo = new PropertyInfo();
          propertyInfo.setName("arg0");
          propertyInfo.setValue(password);
          propertyInfo.setType(String.class);
          request.addProperty(propertyInfo);
  
  
          envelope.setOutputSoapObject(request);
          envelope.bodyOut = request;
  
          //They said they have an authorization, but same error still showed up when I added the header for the                 
          //Authorization...
          //List&lt;HeaderProperty&gt; headers = new ArrayList&lt;HeaderProperty&gt;();
          //String authentication = android.util.Base64.encodeToString(
          //         "user.a:password".getBytes(), android.util.Base64.NO_WRAP);
          //headers.add(new HeaderProperty("Authorization", "Basic " + authentication));
          //// headers.add(new HeaderProperty("Authorization", "user.a:password"));
  
          androidHttpTransport.debug = true;
          androidHttpTransport.call(SOAP_ACTION, envelope);//, headers);
          SoapObject response = (SoapObject) envelope.getResponse();
          result = Boolean.parseBoolean(response.getProperty(0).toString());
  
      }
      catch (Exception E)
      {
          E.printStackTrace();
      }
  
      return result.toString();
  }
  </code></pre>
  
  <p>I'm using ksoap2-android-assembly-2.5.7-jar-with-dependencies.jar as my KSOAP2 library.</p>