Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to call Java Webservice from android application
    primarykey
    data
    text
    <p>I am trying to call java webservice form android application but unable to call it. When I generate <code>WSDL</code> file, <code>SOAPAction</code> showing blank</p> <p><code>string(&lt;soap:operation soapAction=""/&gt;) in soap:operation</code>. </p> <p>My android application code:</p> <pre><code>public class MainActivity extends Activity { private static final String SOAP_ACTION = "http://com/add"; private static final String METHOD_NAME = "add"; private static final String NAMESPACE = "http://com/"; private static final String URL = "http://localhost:8080/WebApplication1/demo"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button=(Button)findViewById(R.id.button1); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); PropertyInfo pi1 = new PropertyInfo(); pi1.setName("i"); pi1.setValue(3); pi1.setType(int.class); request.addProperty(pi1); PropertyInfo pi2 = new PropertyInfo(); pi2.setName("j"); pi2.setValue(3); pi2.setType(int.class); request.addProperty(pi2); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); // HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL); try { ((TextView) findViewById(R.id.textView1)).setText(String .valueOf("The WebService is about to call")); androidHttpTransport.call(SOAP_ACTION, envelope); ((TextView) findViewById(R.id.textView1)).setText(String .valueOf("The WebService call is done")); SoapPrimitive response = (SoapPrimitive) envelope.getResponse(); ((TextView) findViewById(R.id.textView1)).setText(String .valueOf(response.toString())); ((TextView) findViewById(R.id.textView1)).setText(String .valueOf("Done")); } catch (Exception e) { e.printStackTrace(); Log.e("Err", "Error Says: " + e.toString()); } } }); } </code></pre> <p>}</p> <p>There is showing an exception <code>network on main thread exception</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload