0

这对我来说真的很莫名其妙。两天前,我让您的 php-ews 使用限制条件与我的所有 EWS 文件完美配合:

$start = new DateTime('2014-06-05');

$Request->Restriction = new EWSType_RestrictionType();
$Request->Restriction->And = new EWSType_AndType();

$Request->Restriction->And->IsGreaterThan = new EWSType_IsGreaterThanType();
$Request->Restriction->And->IsGreaterThan->FieldURI = new stdClass;
$Request->Restriction->And->IsGreaterThan->FieldURI->FieldURI = 'item:DateTimeSent';
$Request->Restriction->And->IsGreaterThan->FieldURIOrConstant->Constant->Value = $start->format('c');

现在,每当我尝试运行此脚本时,我都会在标题中收到错误消息。我检查过,我的文件确实包含对 SearchExpression 和 SearchExpressionType 的引用。

如有必要,我会非常乐意发布我的 wsdl 和 xsd 文件。任何线索这个错误可能源于什么?

PS我正在使用exhange 2013,我可以很好地接收电子邮件,只是没有限制。

4

2 回答 2

1

尝试将您的messages.xsd、types.xsdservices.wsdl替换为以下文件:https ://github.com/jamesiarmes/php-ews/tree/master/wsdl

我发现文件 types.xsd 已被修改,它与您可以在yopurexchangeserver/ews/services.wsdl上下载的原始文件不同

php soapclient 可能有问题。它不适用于替换组和抽象元素。因此,他们稍微更改了 types.xsd,问题就解决了。

如果要使用 Exchange 2013 中的新 wsdl 文件,则需要以类似的方式对其进行修改。

更改后不要忘记在 php 中关闭 wsdl 缓存:

ini_set("soap.wsdl_cache_enabled", 0);
于 2014-07-28T07:16:45.717 回答
0

我有同样的问题......我发现services.wsdl中的2010和2013之间存在差异所以请求需要不同。但我还没有找到解决方案。

2010年:

<!-- The type of object which actually encodes a restriction -->
  <xs:complexType name="RestrictionType">
    <xs:choice maxOccurs ="unbounded">
      <xs:element ref="t:Contains"/>
      <xs:element ref="t:Excludes"/>
      <xs:element ref="t:Exists"/>
      <xs:element ref="t:IsEqualTo"/>
      <xs:element ref="t:IsNotEqualTo"/>
      <xs:element ref="t:IsGreaterThan"/>
      <xs:element ref="t:IsGreaterThanOrEqualTo"/>
      <xs:element ref="t:IsLessThan"/>
      <xs:element ref="t:IsLessThanOrEqualTo"/>
      <xs:element ref="t:And"/>
      <xs:element ref="t:Not"/>
      <xs:element ref="t:Or"/>
    </xs:choice>
  </xs:complexType>

2013 年:

 <!-- The type of object which actually encodes a restriction -->
  <xs:complexType name="RestrictionType">
    <xs:sequence>
      <xs:element ref="t:SearchExpression"/>
    </xs:sequence>
  </xs:complexType>
于 2014-07-08T07:51:49.727 回答