3.1.4.4 DeleteFolder

The DeleteFolder operation deletes folders from a mailbox. The DeleteFolder operation is used to delete unmanaged folders and managed folders. This operation cannot delete default folders, such as the Inbox folder or the Deleted Items folder. To be deleted, a folder MUST exist.

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

 <wsdl:operation name="DeleteFolder">
     <wsdl:input message="tns:DeleteFolderSoapIn" />
     <wsdl:output message="tns:DeleteFolderSoapOut" />
 </wsdl:operation>

The following is the WSDL binding specification of the DeleteFolder operation.

 <wsdl:operation name="DeleteFolder">
     <soap:operation soapAction="http://schemas.microsoft.com/exchange/services/2006/messages/DeleteFolder" />
     <wsdl:input>
         <soap:header message="tns:DeleteFolderSoapIn" part="Impersonation" use="literal"/>
         <soap:header message="tns:DeleteFolderSoapIn" part="MailboxCulture" use="literal"/>
         <soap:header message="tns:DeleteFolderSoapIn" part="RequestVersion" use="literal"/>
         <soap:body parts="request" use="literal" />
     </wsdl:input>
     <wsdl:output>
         <soap:body parts="DeleteFolderResult" use="literal" />
         <soap:header message="tns:DeleteFolderSoapOut" part="ServerVersion" use="literal"/>
     </wsdl:output>
 </wsdl:operation>

The protocol client sends a DeleteFolderSoapIn request WSDL message, and the protocol server MUST respond with a DeleteFolderSoapOut response WSDL message.

A successful DeleteFolder operation request returns a DeleteFolderResponse element with the ResponseClass attribute of the DeleteFolderResponseMessage element set to "Success" and the ResponseCode element of the DeleteFolderResponse element set to "NoError".

An unsuccessful DeleteFolder operation request returns a DeleteFolderResponse element with the ResponseClass attribute of the DeleteFolderResponseMessage element set to "Error". The ResponseCode element of the DeleteFolderResponseMessage element is set to a value of the ResponseCodeType simple type, as specified in [MS-OXWSCDATA] section 2.2.5.24.