Unable to call SOAP webservice using KSOAP2

by Saravanan.K » Tue, 28 Apr 2009 16:47:49 GMT

Sponsored Links
 i All,

Please help me. Am trying to call a .net webservice from android.... I
have done the emualtor proxy settings and am able to access the
internet on the emulator .... but when i try to access the wsdl file
from my android program am unable to do it... please help me....

Here is the code which am using to call the webservice....

The wsdl just returns HelloWorld string with out accepting any input

class WebServiceClient implements Runnable
private static final String SOAP_ACTION = "http://tempuri.org/
private static final String METHOD_NAME = "HelloWorld";
private static final String NAMESPACE = "http://microsoft.com/
private static final String URL = "http://xxxxxxxxxxxxxxx.com/

public void run() {
// TODO Auto-generated method stub

Log.i("RUN METHOD","Inside the run method");

Log.i("RUN METHOD","End of run method");


public void connect()
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

Log.i("CONNECT METHOD","Inside the connect method");

SoapSerializationEnvelope envelope = new
envelope.dotNet = true;

Log.i("CONNECT METHOD","Inside the connect method 2");


Log.i("CONNECT METHOD","Inside the connect method 3");

HttpTransportSE androidHttpTransport = new HttpTransportSE

Log.i("CONNECT METHOD","Inside the connect method 4");

try {

Log.i("CONNECT METHOD","Inside the connect method 5");

androidHttpTransport.call(SOAP_ACTION, envelope);
Log.i("CONNECT METHOD","Inside the connect method
SoapObject resultsRequestSOAP = (SoapObject)
Log.i("CONNECT METHOD","Inside the connect method
// Vector XXXX = (Vector)
resultsRequestSOAP.getProperty("[Data element name]");

Log.i("CONNECT METHOD","Inside the connect method

Object result = envelope.getResponse();
} catch(Exception E) {
Log.i("ERROR IS",E.toString());



I get an error in this line

androidHttpTransport.call(SOAP_ACTION, envelope);

I have also added the following attributes to the AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET"></uses-

I always get the following error.....

request time failed: java.net.SocketTimeoutException: The operation
timed out

While trying to access the wsdl file with the xml rpc client i was
able to connect to the wsdl file using the following lines

client = new DefaultHtt

Other Threads

1. Android Market - the next logical step

Anybody dispute we're going around in circles for months now?
Let me float the idea that the next logical step would be to see if
Google was interested in entertaining the idea of breaking out Market
and handing it over, possibly in part only, to a third party. Of
course they have the power to keep Market in a limbo. But how long can
they afford to do that. Perhaps it's time to talk about putting an
unsolicited proposal together to take over Market by a focused team
that drives Market forward.

> at

2. OpenGL draws nothing when projection matrix is set to identity

I have an OpenGL app that manipulates it's geometry in screen space to
acheive some effects, and therefore bypasses OpenGL's matrices by
setting modelview and projection to identity. For some reason,
Android's OpenGL implementation seems to be unhappy with this, and
doesn't draw anything.

The same app, compiled from the same source, works fine on windows
and iphone. If I load the app's projection matrix into GL's matrix,
and multiply it's inverse with the final geometry prior to drawing,
then it displays correctly.

App is native and OpenGL is 1.x if it matters.

Any ideas?


3. Garbage activity tracking

4. Saving Pictures from /drawable in a app to SD Card

5. Unmarshal Parcleable in Broadcast Reviever

6. Video: Skyfire 2.0 for Android is Fast

7. Flash 10.1 final available for smartphones with Android 2.2 - GSMArena.com news