Hi All,

 I am trying to use the KSOAP in Android, i have the function as
below. Sometimes the calling of androidHttp.call(GETVERSION_ACTION,
envelope); will return the reponse very fast. But some times it take
me almost one minutes for this AndroidHttpTransport.call get return.
That means AndroidHttpTransport.call() may block for almost one
minutes. I have checked the http package deliver between my client and
server. The HTTP post package send almost one minutes after the time
AndroidHttpTransport.call() be scheduled. So the block time should be
no relationship with network or http server. It blocks the most part
of time before it start to sent the HTTP post package.
 Also getVersion() will be called in multi-thread. Does this will
effect the AndroidHttpTransport.call() function a lot?

Any one comment will be very appreciated.


        public static String getVersion(){
                String version;
                Log.i(TAG,"getVersion****");
                AndroidHttpTransport androidHttp = new 
AndroidHttpTransport(URL);
                //androidHttp.debug = true;
                androidHttp.setXmlVersionTag("<?xml version=\"1.0\" encoding=
\"UTF-8\"?>");
                Log.i(TAG,"new SoapObject()");
                SoapObject request = new SoapObject(NAMESPACE, 
GETVERSION_METHOD);
                Log.i(TAG,"addProperty");
                request.addProperty("v", "1,2");
                SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
                envelope.dotNet = true;
                envelope.implicitTypes = true;

                envelope.setOutputSoapObject(request);

        try {
                Log.i(TAG,"androidHttp.call()");
                androidHttp.call(GETVERSION_ACTION, envelope);
                SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
                //Log.i(TAG,"Reponse dump:"+androidHttp.responseDump);
                //to get the data
                version = result.toString();
                Log.i(TAG,"***envelope.getResponse():"+version);
        }catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return version;
        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to