Compartir a través de


3.1.4.2 SetUserOofSettings Operation

The SetUserOofSettings operation specifies how to set a mailbox user's OOF settings and response message.

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

 <wsdl:operation name="SetUserOofSettings">
   <wsdl:input message="tns:SetUserOofSettingsSoapIn"/>
   <wsdl:output message="tns:SetUserOofSettingsSoapOut"/>
 </wsdl:operation>

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

 <wsdl:operation name="SetUserOofSettings">
   <soap:operation soapAction="http://schemas.microsoft.com/exchange/services/2006/messages/SetUserOofSettings"/>
   <wsdl:input>
     <soap:body parts="SetUserOofSettingsRequest" use="literal"/>
     <soap:header message="tns:SetUserOffSettingsSoapOut" part="Impersonation" use="literal"/>
   </wsdl:input>
   <wsdl:output>
     <soap:body parts="SetUserOofSettingsResult" use="literal"/>
     <soap:header message="tns:SetUserOofSettingsSoapOut" part="ServerVersion" use="literal"/>
   </wsdl:output>
 </wsdl:operation>

For a successful request, the SetUserOofSettings operation MUST return a SetUserOofSettingsResponse element with the ResponseClass attribute of the ResponseMessage element set to "Success". The ResponseCode element of the ResponseMessage element MUST be set to "NoError".

If the request is unsuccessful, the SetUserOofSettings operation MUST return a SetUserOofSettingsResponse element with the ResponseClass attribute of the ResponseMessage element set to "Error". The ResponseCode element of the ResponseMessage element MUST be set to one of the error values listed in the following table.

Error value

Description

ErrorInvalidScheduledOofDuration

Occurs if the specified duration end time is not greater than the start time, or if the end time does not occur in the future, or if the Duration element is not set when the OofState element is set to "Scheduled".

ErrorInvalidUserOofSettings

Occurs when the request is missing an internal or external reply.

If the mailbox that is specified in the request does not belong to the user who is making the request, the server MUST return a SOAP fault. The following XML specifies the SOAP body that MUST be returned in such cases.

 <soap:Body>
     <soap:Fault>
       <faultcode>soap:Client</faultcode>
       <faultstring>Microsoft.Exchange.Data.Storage.AccessDeniedException: User is not mailbox owner. User = *UserID*, MailboxGuid = *MailboxID* ---> User is not mailbox owner. </faultstring>
       <faultactor>https://CAS01.example.com/EWS/Exchange.asmx</faultactor>
       <detail>
         <ErrorCode xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">-2146233088</ErrorCode>
       </detail>
     </soap:Fault>
   </soap:Body>
  

The faultstring element MUST contain the User ID of the user who is making the request and the Mailbox ID of the mailbox for which the attempt was made to change the OOF message.