I'm working on an integration between our web application and Microsoft Exchange 2007. I am using Exchange Web Services (EWS) to communicate to the Exchange Server. However, I am running into some issues with the WSDL. There are several types defined in the WSDL that have elements of abstract types. For example:
<xs:complexType name="RestrictionType">
<xs:sequence>
<xs:element ref="t:SearchExpression"/>
</xs:sequence>
</xs:complexType>
SearchExpression is an abtract type. There are several types that extend SearchExpression such as 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"/>
I would expect to be able to make a valid call that produces the following XML:
<Restriction>
<Exists>
...
</Exists>
</Restriction>
However, when I attempt to make the call using PHP's SoapClient class I receive the following error:
The request failed schema validation: The element 'http://schemas.microsoft.com/exchange/services/2006/types%3ASearchExpression' is abstract or its type is abstract.
If I modify the definition of the RestrictionType type to the follow, the call works:
<xs:element name="Exists" type="t:ExistsType"/>
Is PHP's SOAP handling not able to properly handle abstract types in the WSDL, or could there be something wrong with the WSDL itself? The WSDL is stored locally so I can make edits to it if the need arrises.
Thank you for your help in advance.
Edit:
I just wanted to clarify that I am not forming the XML myself. I am using the following code that should be creating the proper XML:
$request->Restriction->IsGreaterThan->FieldURI->FieldURI =
'item:DateTimeReceived';
$request->Restriction->IsGreaterThan->FieldURIOrConstant
->Constant->Value = date('c', $last_checked_time);