【发布时间】:2009-08-27 13:32:30
【问题描述】:
我正在处理我们的 Web 应用程序和 Microsoft Exchange 2007 之间的集成。我正在使用 Exchange Web 服务 (EWS) 与 Exchange Server 进行通信。但是,我遇到了 WSDL 的一些问题。 WSDL 中定义了几种具有抽象类型元素的类型。例如:
<xs:complexType name="RestrictionType">
<xs:sequence>
<xs:element ref="t:SearchExpression"/>
</xs:sequence>
</xs:complexType>
SearchExpression 是一种抽象类型。有几种扩展 SearchExpression 的类型,例如 ExistsType:
<xs:complexType name="ExistsType">
<xs:complexContent>
<xs:extension base="t:SearchExpressionType">
...
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Exists" type="t:ExistsType" substitutionGroup="t:SearchExpression"/>
我希望能够进行生成以下 XML 的有效调用:
<Restriction>
<Exists>
...
</Exists>
</Restriction>
但是,当我尝试使用 PHP 的 SoapClient 类进行调用时,我收到以下错误:
请求模式验证失败:元素“http://schemas.microsoft.com/exchange/services/2006/types:SearchExpression”是抽象的或其类型是抽象的。
如果我将 RestrictionType 类型的定义修改为以下,则调用有效:
<xs:element name="Exists" type="t:ExistsType"/>
是 PHP 的 SOAP 处理无法正确处理 WSDL 中的抽象类型,还是 WSDL 本身有问题? WSDL 存储在本地,因此我可以在需要时对其进行编辑。
提前感谢您的帮助。
编辑:
我只是想澄清一下,我自己并没有形成 XML。我正在使用以下代码来创建正确的 XML:
$request->Restriction->IsGreaterThan->FieldURI->FieldURI =
'item:DateTimeReceived';
$request->Restriction->IsGreaterThan->FieldURIOrConstant
->Constant->Value = date('c', $last_checked_time);
【问题讨论】:
标签: php web-services soap wsdl