Note that there are some explanatory texts on larger screens.

plurals
  1. POCan not call C# .net Web Service method from Android client
    text
    copied!<p>I am trying to call a web service from Android client using the ksoap library.</p> <p>Here is my android code</p> <pre><code>private static final String SOAP_ACTION = "http://tempuri.org/HelloWorld"; private static final String METHOD_NAME = "HelloWorld"; private static final String NAMESPACE = "http://tempuri.org/"; private static final String URL = "http://192.16.0.230/WebService/Test.asmx"; TextView tv; public void call() { try { SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty("name", "zawoad"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet=true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); androidHttpTransport.call(SOAP_ACTION, envelope); String result = (String)envelope.getResponse(); tv.setText(result); } catch (Exception e) { tv.setText("exception :" + e.getLocalizedMessage()); } } </code></pre> <p>And here is my web service method which is written in Test.asmx file</p> <pre><code>[WebMethod] public string HelloWorld(string name) { return "Hello World" + name; } </code></pre> <p>When the <code>androidHttpTransport.call(SOAP_ACTION, envelope);</code> line is executed it throws the following exception</p> <blockquote> <p>org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG @2:44 in java.io.InputStreamReader@43e593c8)</p> </blockquote> <p>Please help..</p>
 

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