我目前正在学习计算机科学,在我的工作经验中,我的工作导师建议我通过 PHP 中的网站(由我实现)向我的导师 Microsoft EXCHANGE 议程发送约会请求。 不幸的是,我不知道如何做到这一点...。我在 PHP、HTML 和 CSS 方面有很好的知识,但我完全失去了说 Microsoft Exchange 的能力,因为直到我的工作导师问我这个项目之前,我并不真正了解 Microsoft Project。
我的代码(文件:test.php):
<?php
function __autoload($ExchangeWebServices)
{
// Start from the base path and determine the location from the class name,
$base_path = 'C:/wamp/www/new-ews2/php-ews';
$include_file = $base_path . '/' . str_replace('_', '/', $ExchangeWebServices) . '.php';
return (file_exists($include_file) ? require_once $include_file : false);
}
$server='test.fr';
$username='test@test.fr';
$password='testtest';
$ews = new ExchangeWebServices($server, $username, $password);
$request = new EWSType_FindItemType();
$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
$request->ItemShape = new EWSType_ItemResponseShapeType();
$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;
$request->CalendarView = new EWSType_CalendarViewType();
$request->CalendarView->StartDate = date('c', strtotime('2015-06-20 -00'));
$request->CalendarView->EndDate = date('c', strtotime('2015-06-22 -00'));
$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
var_dump($request);
?>
当我进入我的谷歌浏览器并设置时:localhost/new-ews/php-ews/test.php
页面结果:
object(EWSType_FindItemType)[2]
public 'CalendarView' =>
object(EWSType_CalendarViewType)[4]
public 'EndDate' => string '2015-06-22T02:00:00+02:00' (length=25)
public 'MaxEntriesReturned' => null
public 'StartDate' => string '2015-06-20T02:00:00+02:00' (length=25)
public 'ContactsView' => null
public 'DistinguishedGroupBy' => null
public 'FractionalPageItemView' => null
public 'GroupBy' => null
public 'IndexedPageItemView' => null
public 'ItemShape' =>
object(EWSType_ItemResponseShapeType)[3]
public 'AdditionalProperties' => null
public 'BaseShape' => string 'Default' (length=7)
public 'BodyType' => null
public 'ConvertHtmlCodePageToUTF8' => null
public 'FilterHtmlContent' => null
public 'IncludeMimeContent' => null
public 'ParentFolderIds' =>
object(EWSType_NonEmptyArrayOfBaseFolderIdsType)[5]
public 'DistinguishedFolderId' =>
object(EWSType_DistinguishedFolderIdType)[6]
public 'ChangeKey' => null
public 'Id' => string 'calendar' (length=8)
public 'Mailbox' => null
public 'FolderId' => null
public 'QueryString' => null
public 'Restriction' => null
public 'SortOrder' => null
public 'Traversal' => string 'Shallow' (length=7)
我现在不知道如何测试这段代码?我现在问我的导师服务器/用户名/密码吗?还是我的代码好?我有什么改变吗?谢谢
编辑2:请问我可以在哪一行添加此代码?:/