/// <summary> /// Deletes an attachment from an item in the server store. /// </summary> /// <param name="deleteAttachmentRequest">A DeleteAttachmentType complex type specifies a request message to delete an attachment on an item in the server database.</param> /// <returns>A DeleteAttachmentResponseType complex type specifies the response message that is returned by the DeleteAttachment operation.</returns> public DeleteAttachmentResponseType DeleteAttachment(DeleteAttachmentType deleteAttachmentRequest) { DeleteAttachmentResponseType deleteAttachmentResponse = this.exchangeServiceBinding.DeleteAttachment(deleteAttachmentRequest); Site.Assert.IsNotNull(deleteAttachmentResponse, "If the operation is successful, the response should not be null."); this.VerifySoapVersion(); this.VerifyTransportType(); this.VerifyServerVersionInfo(this.exchangeServiceBinding.IsSchemaValidated); this.VerifyDeleteAttachmentResponse(deleteAttachmentResponse, this.exchangeServiceBinding.IsSchemaValidated); return(deleteAttachmentResponse); }
/// <summary> /// Verify the DeleteAttachment operation response. /// </summary> /// <param name="deleteAttachmentResponse">A DeleteAttachmentResponseType instance.</param> private void VerifyDeleteAttachmentSuccessfulResponse(DeleteAttachmentResponseType deleteAttachmentResponse) { foreach (DeleteAttachmentResponseMessageType deleteAttachmentResponseMessage in deleteAttachmentResponse.ResponseMessages.Items) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R203"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R203 Site.CaptureRequirementIfAreEqual<ResponseClassType>( ResponseClassType.Success, deleteAttachmentResponseMessage.ResponseClass, 203, @"[In DeleteAttachment Operation] A successful DeleteAttachment operation request returns a DeleteAttachmentResponse element with the ResponseClass attribute of the DeleteAttachmentResponseMessage element set to ""Success""."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R204"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R204 Site.CaptureRequirementIfAreEqual<ResponseCodeType>( ResponseCodeType.NoError, deleteAttachmentResponseMessage.ResponseCode, 204, @"[In DeleteAttachment Operation][A successful DeleteAttachment operation request returns a DeleteAttachmentResponse element] The ResponseCode element of the DeleteAttachmentResponse element is set to ""NoError""."); } }
/// <summary> /// The capture code for requirements of DeleteAttachment operation. /// </summary> /// <param name="deleteAttachmentResponse">DeleteAttachmentResponseType deleteAttachmentResponse</param> /// <param name="isSchemaValidated">Indicate whether the schema is verified</param> private void VerifyDeleteAttachmentResponse(DeleteAttachmentResponseType deleteAttachmentResponse, bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R382"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R382 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 382, @"[In tns:DeleteAttachmentSoapOut Message][The element of DeleteAttachmentResult part is] tns:DeleteAttachmentResponse (section 3.1.4.2.2.2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R464"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R464 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 464, @"[In tns:DeleteAttachmentSoapOut Message][The DeleteAttachmentResult part] Specifies the SOAP body of the response to a DeleteAttachment operation request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R383"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R383 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 383, @"[In tns:DeleteAttachmentSoapOut Message][The element of ServerVersion part is] t:ServerVersionInfo ([MS-OXWSCDATA] section 2.2.3.12)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R465"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R465 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 465, @"[In tns:DeleteAttachmentSoapOut Message][The ServerVersion part] Specifies a SOAP header that identifies the server version for the response."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R507"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R507 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 507, @"[In Elements] [Element name] [DeleteAttachmentResponse] Specifies the response body content from a request to delete an attachment."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R323"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R323 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 323, @"[In DeleteAttachment Operation] The following is the WSDL port type specification of the operation. <wsdl:operation name=""DeleteAttachment""> <wsdl:input message=""tns:DeleteAttachmentSoapIn"" /> <wsdl:output message=""tns:DeleteAttachmentSoapOut"" /> </wsdl:operation>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R324"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R324 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 324, @"[In DeleteAttachment Operation] The following is the WSDL binding specification of the operation. <wsdl:operation name=""DeleteAttachment""> <soap:operation soapAction=""http://schemas.microsoft.com/exchange/services/2006/messages/DeleteAttachment"" /> <wsdl:input> <soap:header message=""tns:DeleteAttachmentSoapIn"" part=""Impersonation"" use=""literal""/> <soap:header message=""tns:DeleteAttachmentSoapIn"" part=""MailboxCulture"" use=""literal""/> <soap:header message=""tns:DeleteAttachmentSoapIn"" part=""RequestVersion"" use=""literal""/> <soap:body parts=""request"" use=""literal"" /> </wsdl:input> <wsdl:output> <soap:body parts=""DeleteAttachmentResult"" use=""literal"" /> <soap:header message=""tns:DeleteAttachmentSoapOut"" part=""ServerVersion"" use=""literal""/> </wsdl:output> </wsdl:operation>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R462"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R462 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 462, @"[In tns:DeleteAttachmentSoapIn Message][The RequestVersion part] Specifies a SOAP header that identifies the schema version for the DeleteAttachment operation request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R207"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R207 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 207, @"[In Messages][The DeleteAttachmentSoapOut message] Specifies the SOAP message that is returned by the server in response."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R222"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R222 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 222, @"[In tns:DeleteAttachmentSoapOut Message] The DeleteAttachmentSoapOut WSDL message specifies the server response to the DeleteAttachment operation request to delete an attachment. <wsdl:message name=""DeleteAttachmentSoapOut""> <wsdl:part name=""DeleteAttachmentResult"" element=""tns:DeleteAttachmentResponse"" /> <wsdl:part name=""ServerVersion"" element=""t:ServerVersionInfo""/> </wsdl:message>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R326"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R326 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 326, @"[In DeleteAttachmentResponse Element] The DeleteAttachmentResponse element specifies the response message for a DeleteAttachment operation. <xs:element name=""DeleteAttachmentResponse"" type=""m:DeleteAttachmentResponseType"" />"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R510"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R510 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 510, @"[In Complex Types] [Complex type name]DeleteAttachmentResponseType Specifies a response message for the DeleteAttachment operation."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSATT_R246"); // Verify MS-OXWSATT requirement: MS-OXWSATT_R246 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 246, @"[In m:DeleteAttachmentResponseType Complex Type][The DeleteAttachmentResponseType is defined as follow:] <xs:complexType name=""DeleteAttachmentResponseType""> <xs:complexContent> <xs:extension base=""m:BaseResponseMessageType"" /> </xs:complexContent> </xs:complexType>"); foreach (DeleteAttachmentResponseMessageType message in deleteAttachmentResponse.ResponseMessages.Items) { this.VerifyDeleteAttachmentResponseMessageType(message, isSchemaValidated); } }