Android ksoap connection timed out when using more than one device on same wireless network :(
Asked Answered
R

2

1

In short, my application works for longer than year now. I have 100000+ downloads, and only recently the problems with my soap web services started to occur. If two or more devices are connected to the same wireless connection only one device is working properly. On all the other devices connection gets timed out. Here is sample of WS call method:

public static Object callWSMethod(String methodName, String soapAction,
        PropertyInfo[] properties) throws IOException,
        XmlPullParserException{

    SoapObject request = new SoapObject(NAMESPACE, methodName);
    if (properties != null)
        for (PropertyInfo property : properties) {
            request.addProperty(property);
        }

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);
    envelope.implicitTypes = true;

    HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS, 15000);       
    httpTransport.debug = true;             
    httpTransport.call(soapAction, envelope);

    return envelope.getResponse();
}

Any suggestions or ideas would be helpful.

Recessional answered 4/7, 2013 at 21:4 Comment(0)
R
0

Turns out ksoap2 works well, and my code works well. After tracing ksoap call method, and sniffing html traffic I found out that, sometimes, server doesn't respond on my requests. This happens because server configuration was changed and now, when there are a lot of requests from the same IP address, server treats some of them as retransmission and ignores them. This problem has to be solved on server side.

Recessional answered 2/8, 2013 at 13:9 Comment(1)
Hi @Pijetren, i'm facing the same problème with ksoap, would you explain how did you solve this problem on server side. Is there a specific config to be set. ThanksPadishah
D
0

I have set the timeout in milliseconds like below while calling webservice

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL,6000);

(Note - make sure you are using latest ksoap2 library. if you want to download newest version of ksoap2 the follow below link to download)

https://oss.sonatype.org/content/repositories/ksoap2-android-releases//com/google/code/ksoap2-android/ksoap2-android-assembly/3.0.0-RC.4/

and click on ksoap2-android-assembly-3.0.0-RC.4.jar

Douse answered 26/8, 2015 at 10:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.