Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public AsyncTask<String, Void, String> discoverServices() {
- return new AsyncTask<String, Void, String>() {
- @Override
- protected void onPreExecute() {
- super.onPreExecute();
- }
- @Override
- protected String doInBackground(String... params) {
- String resultData = "null";
- try {
- SoapObject request = new SoapObject(Splash.NAMESPACE,
- METHOD_NAME_DISCOVER_SERVICES);
- System.out.println("Setting Property");
- request.addProperty("Name", null);
- request.addProperty("UserId", "[email protected]");
- request.addProperty("Password","demeler@123");
- request.addProperty("Email", null);
- request.addProperty("Role", null);
- SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
- SoapEnvelope.VER11);
- envelope.dotNet = true;
- System.setProperty("http.keepAlive", "false");
- envelope.setOutputSoapObject(request);
- HttpTransportSE androidHttpTransport = new HttpTransportSE(
- Splash.SERVICE_URL, 10000);
- androidHttpTransport.call(SOAP_ACTION_DISCOVER_SERVICES, envelope);
- SoapObject result = (SoapObject) envelope.getResponse();
- resultData = result.toString();
- System.out.println(resultData);
- Log.e("Creating session", "ResultData: " + resultData);
- JSONObject ja = new JSONObject(resultData);
- } catch (SocketTimeoutException e) {
- return "Err: Connection Timeout. \n\nPlease make sure your internet connection is working.";
- } catch (UnknownHostException e) {
- return "Err: Connection Timeout. \n\nPlease make sure your internet connection is working.";
- } catch (ConnectException e) {
- return "Err: Connection Timeout. \n\nPlease make sure your internet connection is working.";
- } catch (Exception e) {
- e.printStackTrace();
- }
- return resultData;
- }
- @Override
- protected void onPostExecute(String result) {
- if (result.contains("Err:"))
- dialog(TransactionActivity.this, "Info", "Unable to update Meeting.", true);
- else {
- dialog(TransactionActivity.this, "Info", "Your meeting " + _meetingNameEditText.getText().toString().trim() + " from " + _timeBookingEditText.getText().toString().replace("-", "to")
- + " updated successfully.", true);
- super.onPostExecute(result);
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment