/**
  * Process a response to verify that it succeeded and take the appropriate
  * action
  *
  * @throws EWS_Exception
  *
  * @param stdClass $response
  * @return EWSType
  *
  * @todo Map the response to a real object.
  */
 protected function processResponse($response)
 {
     // If the soap call failed then we need to thow an exception.
     $code = $this->soap->getResponseCode();
     if ($code != 200) {
         throw new EWS_Exception('SOAP client returned status of ' . $code, $code);
     }
     return $response;
 }
 /**
  * Process a response to verify that it succeeded and take the appropriate
  * action
  * 
  * @throws EWS_Exception
  * 
  * @param stdClass $response
  * @return EWSType
  * 
  * @todo map the response to a real object
  */
 protected function processResponse($response)
 {
     // if the soap call failed then we need to thow an exception
     $code = $this->soap->getResponseCode();
     if ($code != 200) {
         throw new EWS_Exception('SOAP client returned status of ' . $code, $code);
     }
     // end if the soap called
     // TODO: map the response to a real object
     return $response;
 }
    // Create SOAP Client using "basic" authentication
    //$client = new SoapClient('https://e2kx-cas-02.e2kx.mentorg.com/EWS/Services.wsdl',
    $client = new SoapClient($cfg_option['wsdl'], array('exceptions' => 0, 'trace' => 1, 'login' => $userlogin, 'password' => $userpassword));
} else {
    # Use NTLM auth (the default) with CURL
    #Load the NTLMStream and SoapClient extensions
    include "NTLMSoapClient/NTLMSoapClient.php";
    include "NTLMStream/NTLMStream.php";
    include "NTLMSoapClient/Exchange.php";
    include "NTLMStream/Exchange.php";
    #unregister the original https stream handler
    stream_wrapper_unregister('https');
    #tell PHP/Curl to use the new handler
    stream_wrapper_register('https', 'NTLMStream_Exchange') or die("Failed to register protocol");
    #$client = new NTLMSoapClient_Exchange($cfg_option['wsdl'],$options);
    $client = new NTLMSoapClient_Exchange($cfg_option['wsdl'], array("user" => $userlogin, "password" => $userpassword));
}
#start the output
if ($asCGI) {
    print "<html><head><title>Calendar Listing for {$userlogin}</title></head>";
    print "<body bgcolor='#c0c0c0'><br><br><div style='padding:15'><p> Below is a listing of all the Calendars I found in {$userlogin}'s mailbox</p></div>";
    print "<br><br><pre>";
}
#Generate Request to list all the Folders in the mailbox
$FindFolderRequest = null;
$FindFolderRequest->Traversal = 'Deep';
$FindFolderRequest->FolderShape->BaseShape = 'AllProperties';
$FindFolderRequest->ParentFolderIds->DistinguishedFolderId->Id = 'msgfolderroot';
#Make the call to EWS
$result = $client->FindFolder($FindFolderRequest);
#check out the # of CalendarFolder entries. If less than two need to forcibly treat as an array otherwise
示例#4
0
    // Create SOAP Client using "basic" authentication
    //$client = new SoapClient('https://e2kx-cas-02.e2kx.mentorg.com/EWS/Services.wsdl',
    $client = new SoapClient($cfg_option['wsdl'], array('exceptions' => 0, 'trace' => 1, 'login' => $cfg_option['user'], 'password' => $cfg_option['password']));
} else {
    # Use NTLM auth (the default) with CURL
    #Load the NTLMStream and SoapClient extensions
    include "NTLMSoapClient/NTLMSoapClient.php";
    include "NTLMStream/NTLMStream.php";
    include "NTLMSoapClient/Exchange.php";
    include "NTLMStream/Exchange.php";
    #unregister the original https stream handler
    stream_wrapper_unregister('https');
    #tell PHP/Curl to use the new handler
    stream_wrapper_register('https', 'NTLMStream_Exchange') or die("Failed to register protocol");
    #$client = new NTLMSoapClient_Exchange($cfg_option['wsdl'],$options);
    $client = new NTLMSoapClient_Exchange($cfg_option['wsdl'], array("user" => $cfg_option['user'], "password" => $cfg_option['password']));
}
#Set the header for the SOAP Client to be right version of Exchange.
$rsv = array('Version' => $cfg_option['exchangever']);
$header = new SoapHeader('http://schemas.microsoft.com/exchange/services/2006/types', 'RequestServerVersion', $rsv);
$client->__setSoapHeaders($header);
# let's parse the path info to figure out the calendard we want to get
# PathInfo should be something like: /testuser1-default
$origpathinfo = $_SERVER["PATH_INFO"];
$fields = split('/', $origpathinfo);
$userfeedtogen = $fields[1];
#
#Let's see if we can find this calendar in the list of PFIDs from the config file.
# if not we need to bail....
if (!isset($PFIDs[$userfeedtogen])) {
    header("HTTP/1.1 404 404 Unknown User and/or Calendar");