php-ews class library always returns null

半世苍凉 提交于 2019-12-08 07:39:23

问题


I am trying to make SOAP calls to our Exchange server using the classes I found here:

http://code.google.com/p/php-ews/

I have coded up a few examples, starting with the basic example as below and no matter what I try and do this always returns null.

$ews = new ExchangeWebServices('exchange.example.com', 'user', 'password');

$request = new EWSType_FindFolderType();
$request->Traversal = EWSType_FolderQueryTraversalType::SHALLOW;
$request->FolderShape = new EWSType_FolderResponseShapeType();
$request->FolderShape->BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;

$request->IndexedPageFolderView = new EWSType_IndexedPageViewType();
$request->IndexedPageFolderView->BasePoint = 'Beginning';
$request->IndexedPageFolderView->Offset = 0;

$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::INBOX;

$response = $ews->FindFolder($request);
var_dump($response);

Has anyone else encountered this error, or can maybe shed some light on it for me?


回答1:


Your request looks fine, it should work. Did you set up services.wsdl with your EWS server address? (see http://ewswrapper.lafiel.net/basic-info/working-with-ewswrapper/ for some more info)

Try looking at the actual call before it is send and the response before it is interpreted. To do so in NTMLSoapClinet.php print $request at the top of __doRequest() function and end script execution (ie. die()) and then try printing $response befor it is returned in __doRequest() function and end script execution. This should give you some more insight on what's going on.



来源:https://stackoverflow.com/questions/7529388/php-ews-class-library-always-returns-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!