title: Calling asmx web Service from Android errors: "java.io.IOException:HTTP request failed, HTTP status: 500"
body: <p>I'm trying to call .asmx web service from Android. Below you can see my code. It's working when I use it for another web service but it doesn't work for one I need to use. 
  The problem is "java.io.IOException:HTTP request failed, HTTP status: 500" exception. 
  Firstly i assume that the problem is from the web service side. However it works when i try to reach using Devexpress and .NET. </p>
  
  <p>I tried to get same error from Devexpress, when I remove "contentType: "application/json; charset=utf-8"," line.  </p>
  
  <p>Note: There is no error at web service definitions.</p>
  
  <p>private class KullaniciServiceAsync extends AsyncTask  {</p>
  
  <pre><code>    protected void onPreExecute(){
          Toast.makeText(getApplicationContext(), "Kullanici Bilgileri Alınıyor...", Toast.LENGTH_SHORT).show();
      }
      @Override
      protected KullaniciBilgisiGetir doInBackground(String... Str) {
          try {
              //ArrayList&lt;HeaderProperty&gt; headerProperty = new ArrayList&lt;HeaderProperty&gt;();  
              //headerProperty.add(new HeaderProperty("Content-Type", "application/json; charset=utf-8")); 
              k = new KullaniciBilgisiGetir();    
              SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
              request.addProperty("UserId","1234567890");
              request.addProperty("Password",Pass);
              request.addProperty("Kod",Kod);
              request.addProperty("Sifre",Sifre);
              SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
              envelope.dotNet = true;
              envelope.setOutputSoapObject(request);
              Log.e("Request",request.toString());
              HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
              androidHttpTransport.debug = true;
              try{
                   androidHttpTransport.call(SOAP_ACTION, envelope);
                   SoapObject response = (SoapObject) envelope.getResponse();
                   if (response.hasProperty("KResult")) {
                      if (response.getPropertyAsString("KResult") == null) {
                        k.setKullaniciRespond(null);
                      } else {
                        k.setKullaniciRespond(response.getPropertyAsString("KResult"));
                      }
                   }
  
               }catch(Exception e){
                   Log.e("httpTRYCATCH", e.toString());
               }
          } catch (Exception e) {
            Log.e("ilkTRY",e.toString());
          }              
          return k;
      }
  
      protected void onPostExecute(KullaniciBilgisiGetir e){
          txt1.setText("ResponseText   -&gt;" + e.getKullaniciRespond());
          //txt2.setText("bu "+e.getResponse());
          //txt3.setText("Count "+count);
      }
  
  }
  </code></pre>