/* $recurrAppointments=array(); foreach ($appointments as $appointment) { array_push($recurrAppointments,"appointment"=>appointment); } */ try { $client = new SoapClient($wsdl, array('location' => $location)); if ($requestType == "User") { $result = $client->scheduleUserAppointments(array('requestingUser' => $requestingUser, 'appointment' => $appointments)); } else { if ($requestType == "Mentor") { $result = $client->scheduleMentorAppointments(array('requestingUser' => $requestingUser, 'appointment' => $appointments)); } else { if ($requestType == "Host") { $result = $client->scheduleHostAppointments(array('requestingUser' => $requestingUser, 'appointment' => $appointments)); } } } echo json_encode($result->appointment); //print_r($result->appointment); } catch (SoapFault $soapfault) { //echo $soapfault->getMessage(); echo $soapfault->getTraceAsString(); } catch (Exception $e) { echo $e->getMessage(); } } else { if ($action == 'cancelAppointment') { header('Content-Type: text/xml'); if (isset($_POST['id'])) {