title: getting java.io.IOException: HTTP request failed, HTTP status: 404 in ksoap2 while passing xml data to soap1.2 android
body: <p>i have to pass </p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8' ?&gt;
  &lt;hello&gt;&lt;username&gt;test@test.com&lt;/username&gt;
  &lt;password&gt;test&lt;/password&gt;&lt;/hello&gt;
  </code></pre>
  
  <p>to</p>
  
  <p><strong>Wsdl</strong></p>
  
  <pre><code>&lt;wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="SilentManagerAPI" targetNamespace="http://tempuri.org/"&gt;
  &lt;wsp:Policy wsu:Id="WSHttpBinding_ISilentManagerAPI_policy"&gt;
  &lt;wsp:ExactlyOne&gt;
  &lt;wsp:All&gt;
  &lt;wsaw:UsingAddressing/&gt;
  &lt;/wsp:All&gt;
  &lt;/wsp:ExactlyOne&gt;
  &lt;/wsp:Policy&gt;
  &lt;wsdl:types&gt;
  &lt;xsd:schema targetNamespace="http://tempuri.org/Imports"&gt;
  &lt;xsd:import schemaLocation="http://myurl.com/Service.svc?xsd=xsd0" namespace="http://tempuri.org/"/&gt;
  &lt;xsd:import schemaLocation="http://myurl.com/Service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/&gt;
  &lt;/xsd:schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name="ISilentManagerAPI_Service_InputMessage"&gt;
  &lt;wsdl:part name="parameters" element="tns:Service"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name="ISilentManagerAPI_Service_OutputMessage"&gt;
  &lt;wsdl:part name="parameters" element="tns:ServiceResponse"/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name="ISilentManagerAPI"&gt;
  &lt;wsdl:operation name="Service"&gt;
  &lt;wsdl:input wsaw:Action="http://tempuri.org/ISilentManagerAPI/Service" message="tns:ISilentManagerAPI_Service_InputMessage"/&gt;
  &lt;wsdl:output wsaw:Action="http://tempuri.org/ISilentManagerAPI/ServiceResponse" message="tns:ISilentManagerAPI_Service_OutputMessage"/&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:binding name="WSHttpBinding_ISilentManagerAPI" type="tns:ISilentManagerAPI"&gt;
  &lt;wsp:PolicyReference URI="#WSHttpBinding_ISilentManagerAPI_policy"/&gt;
  &lt;soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;wsdl:operation name="Service"&gt;
  &lt;soap12:operation soapAction="http://tempuri.org/ISilentManagerAPI/Service" style="document"/&gt;
  &lt;wsdl:input&gt;
  &lt;soap12:body use="literal"/&gt;
  &lt;/wsdl:input&gt;
  &lt;wsdl:output&gt;
  &lt;soap12:body use="literal"/&gt;
  &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:service name="SilentManagerAPI"&gt;
  &lt;wsdl:port name="WSHttpBinding_ISilentManagerAPI" binding="tns:WSHttpBinding_ISilentManagerAPI"&gt;
  &lt;soap12:address location="http://myurl.com/Service.svc/Service.svc"/&gt;
  &lt;wsa10:EndpointReference&gt;
  &lt;wsa10:Address&gt;
  http://myurl.com/Service.svc/Service.svc
  &lt;/wsa10:Address&gt;
  &lt;/wsa10:EndpointReference&gt;
  &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  
  <p><strong>Code Tried :</strong></p>
  
  <pre><code>import android.os.AsyncTask;
  import android.os.Bundle;
  
  import android.util.Log;
  import android.widget.TextView;
  import android.app.Activity;
  import android.app.Dialog;
  import android.app.ProgressDialog;
  import android.content.DialogInterface;
  import android.content.DialogInterface.OnCancelListener;
  
  import java.io.Writer;
  
  import org.ksoap2.*;
  import org.ksoap2.serialization.*;
  import org.ksoap2.transport.*;
  import org.xmlpull.v1.XmlSerializer;
  
  public class MainActivity extends Activity {
  
      private static final String METHOD_NAME = "Service"; 
      private static final String NAMESPACE = "http://tempuri.org/"; 
      private static final String URL = "http://myurl.com/Service.svc";
      final String SOAP_ACTION = "http://tempuri.org/ISilentManagerAPI/Service";
  
      TextView tv;
      StringBuilder sb;
      private XmlSerializer writer;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          tv = new TextView(this);
          sb = new StringBuilder();
          new testReq().execute();
          tv.setText(sb.toString());
          setContentView(tv);
      }
  
      class testReq extends AsyncTask&lt;Void, Void, Void&gt; {
          Dialog dialog;
  
          @Override
          protected void onPreExecute() {
              // TODO Auto-generated method stub
              super.onPreExecute();
              dialog = ProgressDialog.show(MainActivity.this, "Please Wait...",
                      "Testing........");
              dialog.setCancelable(true);
              dialog.setOnCancelListener(new OnCancelListener() {
  
                  @Override
                  public void onCancel(DialogInterface dialog) {
                      // TODO Auto-generated method stub
                      cancel(true);
                  }
              });
  
          }
  
          @Override
          protected void onPostExecute(Void result) {
              // TODO Auto-generated method stub
              super.onPostExecute(result);
              dialog.dismiss();
          }
  
          @Override
          protected Void doInBackground(Void... params) {
              // TODO Auto-generated method stub
              call();
              return null;
          }
      }
  
      public void call() {
          try {
  
              SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
  
              PropertyInfo req = new PropertyInfo();
              req.name = "hello";
              req.type = String.class;
              req.setValue("&lt;hello&gt;" + "&lt;username&gt;test@test.com&lt;/username&gt;"
                      + "&lt;password&gt;test123&lt;/password&gt;" + "&lt;/hello&gt;");
              request.addProperty(req);
  
              SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                      SoapEnvelope.VER11);
              envelope.dotNet = true;
              envelope.setOutputSoapObject(request);
  
              HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
              androidHttpTransport.call(SOAP_ACTION, envelope);
              SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
  
              String resultData = result.toString();
              Log.i("Result", "" + resultData);
  
              sb.append(resultData + "\n");
          } catch (Exception e) {
              sb.append("Error:\n" + e.getMessage() + "\n");
              e.printStackTrace();
          }
  
      }
  }
  </code></pre>
  
  <p>i am using internet permission in <code>AndroidManifest.xml</code></p>
  
  <pre><code>  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  </code></pre>
  
  <p><strong>and output will be like</strong></p>
  
  <pre><code>&lt;hello&gt;
    &lt;username&gt;any&lt;/username&gt;
    &lt;myoutputdata&gt;
      .
      . return data
      .    
    &lt;/myoutputdata&gt;
  &lt;/silent&gt;
  </code></pre>
  
  <p>After Trying this code getting <code>exception</code></p>
  
  <p><strong>LogCat</strong></p>
  
  <pre><code>08-01 13:27:53.240: W/System.err(10915): java.io.IOException: HTTP request failed, HTTP status: 404
  08-01 13:27:53.300: W/System.err(10915):    at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:195)
  08-01 13:27:54.370: W/System.err(10915):    at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:116)
  08-01 13:27:54.390: W/System.err(10915):    at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:111)
  08-01 13:27:54.410: W/System.err(10915):    at com.example.testeset.MainActivity.call(MainActivity.java:105)
  08-01 13:27:54.440: W/System.err(10915):    at com.example.testeset.MainActivity$testReq.doInBackground(MainActivity.java:80)
  08-01 13:27:54.460: W/System.err(10915):    at com.example.testeset.MainActivity$testReq.doInBackground(MainActivity.java:1)
  08-01 13:27:54.470: W/System.err(10915):    at android.os.AsyncTask$2.call(AsyncTask.java:264)
  08-01 13:27:54.480: W/System.err(10915):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  08-01 13:27:54.490: W/System.err(10915):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  08-01 13:27:54.500: W/System.err(10915):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
  08-01 13:27:54.500: W/System.err(10915):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  08-01 13:27:54.500: W/System.err(10915):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  08-01 13:27:54.500: W/System.err(10915):    at java.lang.Thread.run(Thread.java:856)
  </code></pre>
  
  <p><strong>Here i am getting Exception:</strong></p>
  
  <pre><code>androidHttpTransport.call(SOAP_ACTION, envelope);
  </code></pre>