function unintall_app_by_app_id($app_id) { // Invoke Web Services $webServiceAddress = getWebServiceAddress(); ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient($webServiceAddress, array('encoding' => 'UTF-8')); try { $vin = getVIN(); $param = array('arg0' => $vin, 'arg1' => $app_id); $ret = $client->uninstall($param); //print_r($ret); if ($ret->return) { echo "<font color='green'>Application is uninstalling...</font>"; } else { echo "<font color='red'>Application failed uninstallation</font>"; } } catch (SoapFault $exception) { print $exception; } // Synchronize DB //$field_name = "INSTALLED_APPS"; //$apps = get_cimyFieldValue(getVIN(), $field_name); /* $apps = getInstalledApps(getVIN()); if (strpos($apps, ',') !== false) { $apps_array = explode(',', $apps); } else { $apps_array = array($apps); } $removed_array = array_diff($apps_array, array($app_id)); $size = count($removed_array); if($size == 0) { $result = ""; } else if ($size == 1) { $result = $removed_array[0]; } else { $result = implode(',', $removed_array); } removeInstalledApp($result); */ }