header('Content-Type: text/xml');
     if (isset($_POST['affiliationId'])) {
         $requestingUser = $_POST['requestingUser'];
         $affiliationId = $_POST['affiliationId'];
         $requestType = $_POST['requestType'];
     } else {
         $action = "";
     }
     try {
         $params = array('requestingUser' => $requestingUser, 'affiliationId' => $affiliationId);
         $client = new SoapClient($wsdl, array('location' => $location));
         if ($requestType == "User") {
             $result = $client->cancelAllUserAppointments($params);
         } else {
             if ($requestType == "Mentor") {
                 $result = $client->cancelAllMentorAppointments($params);
             } else {
                 if ($requestType == "Host") {
                     $result = $client->cancelAllHostAppointments($params);
                 }
             }
         }
         $xml = new array2xml('results');
         $xml->createNode($result);
         echo $xml;
     } catch (Exception $e) {
         echo $e->getMessage();
     } catch (SoapFault $soapfault) {
         echo $soapfault->getMessage();
     }
 } else {