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.

2 Answers 2

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.

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. Thanks
    – sansa
    Apr 25, 2019 at 10:01
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.