gonzalob

Untitled

Feb 24th, 2020
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. public static String requestNoticias(String str, String str2, String str3) throws HttpResponseException, IOException, XmlPullParserException {
  2. SoapObject soapObject = new SoapObject(NAMESPACE, str);
  3. soapObject.addProperty(param_cantidad, str2);
  4. soapObject.addProperty(param_principales, str3);
  5. SoapSerializationEnvelope soapSerializationEnvelope = new SoapSerializationEnvelope(110);
  6. soapSerializationEnvelope.dotNet = true;
  7. soapSerializationEnvelope.setOutputSoapObject(soapObject);
  8. HttpTransportSE httpTransportSE = new HttpTransportSE(URL);
  9.  
  10. httpTransportSE.debug = true;
  11. ArrayList arrayList = new ArrayList();
  12. StringBuilder sb = new StringBuilder();
  13. sb.append("Basic ");
  14. sb.append(Base64.encode(user.getBytes()));
  15. arrayList.add(new HeaderProperty("Authorization", sb.toString()));
  16. arrayList.add(new HeaderProperty("http.keepAlive", "false"));
  17. arrayList.add(new HeaderProperty("Accept-Encoding", "utf-8"));
  18. arrayList.add(new HeaderProperty("Accept-Charset", "utf-8"));
  19. arrayList.add(new HeaderProperty("Content-Type", "text/xml; charset=utf-8"));
  20. httpTransportSE.call(SOAP_ACTION, soapSerializationEnvelope, arrayList);
  21. String responseDump = httpTransportSE.responseDump;
  22. String respuesta = StringFormatter.convertStringToUTF8(responseDump);
  23. Log.d("response", responseDump);
  24. return responseDump;
  25. }
Add Comment
Please, Sign In to add comment