3.1.4.1 GetUserAvailability Operation

The GetUserAvailability operation provides current user availability information at a specified level of detail.<3>

The following is the WSDL port type specification of this operation.

 <wsdl:operation name="GetUserAvailability">
     <wsdl:input message="tns:GetUserAvailabilitySoapIn" />
     <wsdl:output message="tns:GetUserAvailabilitySoapOut" />
 </wsdl:operation>

The following is the WSDL binding specification of this operation.<4>

 <wsdl:operation name="GetUserAvailability">
    <soap:operation soapAction="http://schemas.microsoft.com/exchange/
 services/2006/messages/GetUserAvailability"/>
    <wsdl:input>
       <soap:header message="tns:GetUserAvailabilitySoapIn" part="Impersonation" use="literal"/>
       <soap:header message="tns:GetUserAvailabilitySoapIn" part="TimeZoneContext" use="literal"/>
       <soap:header message="tns:GetUserAvailabilitySoapIn" part="RequestVersion" use="literal"/>
       <soap:body parts="GetUserAvailabilityRequest" use="literal"/>
    </wsdl:input>
     <wsdl:output>
       <soap:body parts="GetUserAvailabilityResult" use="literal"/>
       <soap:header message="tns:GetUserAvailabilitySoapOut"
 part="ServerVersion" use="literal"/>
    </wsdl:output>
 </wsdl:operation>

For a successful request, the GetUserAvailability operation MUST return a GetUserAvailabilityResponse element with the ResponseClass attribute ([MS-OXWSCDATA] section 2.2.4.65) of the ResponseMessage element (section 3.1.4.1.3.11) set to "Success". The ResponseCode attribute ([MS-OXWSCDATA] section 2.2.4.65) of the ResponseMessage element MUST be set to "NoError".

If one or more of the mailboxes in the MailboxDataArray element (section 3.1.4.1.3.14) in the GetUserAvailabilityRequest element (section 3.1.4.1.1.1) is not found in the directory service, the server MUST return a ResponseMessage element in the FreeBusyResponseArray element (section 3.1.4.1.3.15) of the GetUserAvailabilityResponse element (section 3.1.4.1.1.2) with the ResponseClass attribute of the ResponseMessage element set to "Error" and the MessageText element ([MS-OXWSCDATA] section 2.2.4.65) of the ResponseMessage element set to "Unable to resolve email address <SMTP address> to an Active Directory object", where <SMTP address> is replaced with the email address that cannot be resolved.

If there are no mailboxes specified in the request, the server MUST return a SOAP fault. The following XML specifies the SOAP body that MUST be returned.

 <?xml version="1.0" encoding="utf-8" ?> 
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
 <soap:Header> 
 <t:ServerVersionInfo MajorVersion="8" MinorVersion="1" MajorBuildNumber="240" MinorBuildNumber="5" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" /> 
 </soap:Header> 
 <soap:Body> 
 <soap:Fault> 
 <faultcode>soap:Client</faultcode> 
 <faultstring>Microsoft.Exchange.InfoWorker.Common.Availability.IdentityArrayEmptyException: The MailboxData array is empty. ---> The MailboxData array is empty.</faultstring> 
 <faultactor>https://server/ews/exchange.asmx</faultactor> 
 <detail> 
 <ErrorCode xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">5001</ErrorCode> 
 </detail> 
 </soap:Fault> 
 </soap:Body> 
 </soap:Envelope>