Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have searched for many things on the null pointer exception some suggested to use Http keep-Alive and some suggested to use different versions for Ksoap2 none of them were helpful. So i started to mess with the sources. I have solved the problem by a simple hack. This hack helped me because i was only getting null pointer exceptions on the very first ksoap2 call i made. After the first call all the ksoap2 calls are successful. So i am not proposing this as an answer but in case if some one is also facing the same problem they can download ksoap2 sources and edit the HttpTransportSE's call function as follows.</p> <pre><code>public List call(String soapAction, SoapEnvelope envelope, List headers) throws IOException, XmlPullParserException { return call(soapAction, envelope, headers, null); } public List callWithRetry(String soapAction, SoapEnvelope envelope, List headers, int numRetries) throws IOException, XmlPullParserException { for (int i=0; i&lt;=numRetries; i++) { try { return call(soapAction, envelope, headers, null); } catch (IOException e) { if (i==numRetries) { throw e; } } catch (XmlPullParserException e) { if (i==numRetries) { throw e; } } } return null; } </code></pre> <p>I just added the numOfRetries just in case if i needed more than a single try. And i called the callwithretry function where ever i get the null pointer exception. Every thing worked like a charm. Note: Here we are making the server request more than once if the call fails. If in any case you do not want that use the old call function.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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