echo json_encode($result->appointment); } catch (SoapFault $soapfault) { //echo $soapfault->getMessage(); echo $soapfault->getTraceAsString(); } catch (Exception $e) { echo $e->getMessage(); } } else { if ($action == 'getUserCurrentTime') { header('Content-Type: text/x-json'); $username = $_POST['username']; try { $params = array('userName' => $username); // print_r($params); $client = new SoapClient($wsdl, array('location' => $location)); $result = $client->getUserCurrentTime($params); echo json_encode($result->time); } catch (SoapFault $soapfault) { //echo $soapfault->getMessage(); echo $soapfault->getTraceAsString(); } catch (Exception $e) { echo $e->getMessage(); } // sms: 7/2/2014 Added to support embedded version } else { if ($action == 'getUserProfileByUsername') { header('Content-Type: text/x-json'); $username = $_POST['username']; try { $params = array('userName' => $username); // print_r($params);