title: Connection reset by peer Exception in Soap Webservice calling
body: <p>I am calling Soap web service. It works proper but some times I am getting connection reset by peer exception. </p>
  
  <p>This is my code of web service calling</p>
  
  <pre><code>    new Thread(new Runnable() {
                  public void run() {
                      Looper.prepare();
                      String response = "";
                      SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                      envelope.dotNet = true;
                      envelope.setOutputSoapObject(serverRequestParams.getSoapObject());
  
                      HttpTransportSE httpTransport = new HttpTransportSE(serverRequestParams.getUrl(),90000);
                      httpTransport.debug = true;
                      try {
  
                          HttpParams my_httpParams = new BasicHttpParams(); 
                          final String proxyHost = android.net.Proxy.getDefaultHost();
                          final int proxyPort = android.net.Proxy.getDefaultPort();
                          if(proxyPort != -1)
                          {
                              my_httpParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxyHost, proxyPort));            
                          }
  
                          httpTransport.call(serverRequestParams.getSoapAction(), envelope);
                          Object data = envelope.getResponse();
                          if (data instanceof SoapObject) {
                              SoapObject data2 = (SoapObject) data;
                              response = data2.toString();
                          } else if (data instanceof SoapPrimitive) {
                              SoapPrimitive data3 = (SoapPrimitive) data;
                              response = data3.toString();
                          } else if (data != null) {
                              response = data.toString();
                          } else if (data == null) {
                              response = "nodata";
                          }
                      } 
                      catch (Exception e) {
                          System.out.print("Exception:"+e);
                      }
  </code></pre>