SHARE
TWEET

Untitled

a guest Jan 21st, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. **DefaultHttpClient httpC = new DefaultHttpClient();
  2.     HttpProtocolParams.setUseExpectContinue(httpC.getParams(), false);
  3.     HttpConnectionParams.setConnectionTimeout(httpC.getParams(), 15000);
  4.     HttpConnectionParams.setSoTimeout(httpC.getParams(), 15000);
  5.     HttpPost httpPost = new HttpPost(WebServiceDetails.URL_WS_USER);
  6.     httpPost.setHeader("SOAPAction", soapAction);
  7.  
  8.  
  9.     try {
  10.         se = new StringEntity(serviceXml,HTTP.UTF_8);
  11.         se.setContentType("text/xml");
  12.         httpPost.setEntity(se);
  13.         BasicHttpResponse basicHttpResponse =   (BasicHttpResponse)httpC.execute(httpPost);
  14.         HttpEntity responseEntity = basicHttpResponse.getEntity();
  15.         InputStream inputStream = null;
  16.         inputStream = responseEntity.getContent();
  17.         BufferedReader r = new BufferedReader(new InputStreamReader(inputStream),1024*5);
  18.         StringBuilder total = new StringBuilder();
  19.         String line;
  20.         while ((line = r.readLine()) != null) {
  21.             total.append(line);
  22.         }
  23.         System.out.println("Response from service -"+total.toString());
  24.         xmlContent=total.toString();
  25.         System.out.println(" status Line = "+basicHttpResponse.getStatusLine());
  26.  
  27.  
  28.     }catch (Exception e){e.printStackTrace();}**
  29.    
  30. HttpConnectionParams.setConnectionTimeout(httpC.getParams(), 40000); //40 seconds
  31. HttpConnectionParams.setSoTimeout(httpC.getParams(), 40000);         //40 seconds
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top