HttpRunnable.java 977 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.dbs.mplus.knuh.httpTask;
  2. import org.ksoap2.serialization.SoapObject;
  3. import java.util.HashMap;
  4. import java.util.concurrent.ExecutionException;
  5. public class HttpRunnable implements Runnable {
  6. private static final String TAG = "HttpRunnable";
  7. private String soapAction = "";
  8. private String callMethod = "";
  9. private HashMap<String, String> mData;
  10. private CallBack callBack;
  11. public HttpRunnable (String soapAction, String callMethod, HashMap<String, String> mData, CallBack callBack) {
  12. this.soapAction = soapAction;
  13. this.callMethod = callMethod;
  14. this.mData = mData;
  15. this.callBack = callBack;
  16. }
  17. @Override
  18. public void run() {
  19. try {
  20. HttpSoapConnection httpSoapConnection = new HttpSoapConnection(soapAction, callMethod, mData);
  21. SoapObject result = httpSoapConnection.execute().get();
  22. callBack.result(result);
  23. } catch (ExecutionException e) {
  24. } catch (InterruptedException e) {
  25. }
  26. }
  27. }