问题描述
我正在尝试使用在这里找到的类对我们的Exchange服务器进行SOAP调用:
I am trying to make SOAP calls to our Exchange server using the classes I found here:
http://code.google.com/p/php-ews/
我已经编写了一些示例,从下面的基本示例开始,无论我尝试执行什么操作,总是返回null.
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?
推荐答案
您的请求看起来不错,应该可以正常工作.您是否使用EWS服务器地址设置了services.wsdl? (请参见 http://ewswrapper.lafiel.net/basic-info/working- with-ewswrapper/了解更多信息)
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)
尝试在发送之前查看实际的呼叫,并在解释其之前查看响应.为此,在NTMLSoapClinet.php中,在__doRequest()函数顶部打印$ request并结束脚本执行(即die()),然后尝试打印$ response,因为它在__doRequest()函数中返回并结束脚本执行.这应该使您对正在发生的事情有更多的了解.
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.
这篇关于php-ews类库始终返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!