A class indicates the response body of GetPropList request
상속: AddressBookResponseBodyBase
예제 #1
0
        /// <summary>
        /// Parse the GetPropList request type response body.
        /// </summary>
        /// <param name="rawData">The raw data of response.</param>
        /// <returns>The GetPropList request type response body.</returns>
        public static GetPropListResponseBody Parse(byte[] rawData)
        {
            GetPropListResponseBody responseBody = new GetPropListResponseBody();
            int index = 0;

            responseBody.StatusCode = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            responseBody.HasPropertyTags = BitConverter.ToBoolean(rawData, index);
            index += sizeof(bool);
            if (responseBody.HasPropertyTags)
            {
                responseBody.PropertyTags = LargePropertyTagArray.Parse(rawData, ref index);
            }
            else
            {
                responseBody.PropertyTags = null;
            }

            responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index);
            index += 4;
            responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize];
            Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize);
            return(responseBody);
        }
        /// <summary>
        /// Parse the GetPropList request type response body.
        /// </summary>
        /// <param name="rawData">The raw data of response.</param>
        /// <returns>The GetPropList request type response body.</returns>
        public static GetPropListResponseBody Parse(byte[] rawData)
        {
            GetPropListResponseBody responseBody = new GetPropListResponseBody();
            int index = 0;

            responseBody.StatusCode = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index);
            index += sizeof(uint);
            responseBody.HasPropertyTags = BitConverter.ToBoolean(rawData, index);
            index += sizeof(bool);
            if (responseBody.HasPropertyTags)
            {
                responseBody.PropertyTags = LargePropertyTagArray.Parse(rawData, ref index);
            }
            else
            {
                responseBody.PropertyTags = null;
            }

            responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index);
            index += 4;
            responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize];
            Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize);
            return responseBody;
        }
        /// <summary>
        /// This method is used by the client to get a list of all of the properties that have values on an object.
        /// </summary>
        /// <param name="getPropListRequestBody">The GetPropList request type request body.</param>
        /// <returns>The response body of the GetPropList request type.</returns>
        public GetPropListResponseBody GetPropList(GetPropListRequestBody getPropListRequestBody)
        {
            CommonResponse          commonResponse          = this.SendAddressBookRequest(getPropListRequestBody, RequestType.GetPropList);
            GetPropListResponseBody getPropListResponseBody = GetPropListResponseBody.Parse(commonResponse.ResponseBodyRawData);

            this.VerifyGetPropListResponseBody(getPropListResponseBody);

            return(getPropListResponseBody);
        }
예제 #4
0
        /// <summary>
        /// Verify the requirements related with GetPropList request type response body. 
        /// </summary>
        /// <param name="getPropListResponseBody">The response body of GetPropList request type.</param>
        private void VerifyGetPropListResponseBody(GetPropListResponseBody getPropListResponseBody)
        {
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R579");
        
            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R579
            this.Site.CaptureRequirementIfIsInstanceOfType(
                getPropListResponseBody.StatusCode,
                typeof(uint),
                579,
                @"[In GetPropList Request Type Success Response Body] StatusCode (4 bytes): An unsigned integer that specifies the status of the request.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R580");
        
            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R580
            this.Site.CaptureRequirementIfAreEqual<uint>(
                0,
                getPropListResponseBody.StatusCode,
                580,
                @"[In GetPropList Request Type Success Response Body] [StatusCode] This field MUST be set to 0x00000000.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R581");
        
            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R581
            this.Site.CaptureRequirementIfIsInstanceOfType(
                getPropListResponseBody.ErrorCode,
                typeof(uint),
                581,
                @"[In GetPropList Request Type Success Response Body] ErrorCode (4 bytes): An unsigned integer that specifies the return status of the operation.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R582");
        
            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R582
            this.Site.CaptureRequirementIfIsInstanceOfType(
                getPropListResponseBody.HasPropertyTags,
                typeof(bool),
                582,
                @"[In GetPropList Request Type Success Response Body] HasPropertyTags (1 byte): A Boolean value that specifies whether the PropertyTags field is present.");

            if (getPropListResponseBody.HasPropertyTags)
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R584");
        
                // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R584
                // Because the HasPropertyTags field is true, so if the PropertyTags field has value, R584 will be verified. 
                this.Site.CaptureRequirementIfIsNotNull(
                    getPropListResponseBody.PropertyTags,
                    584,
                    @"[In GetPropList Request Type Success Response Body] [PropertyTags] This field is present when the value of the HasPropertyTags field is nonzero.");
            }
            
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R587");
        
            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R587
            this.Site.CaptureRequirementIfIsInstanceOfType(
                getPropListResponseBody.AuxiliaryBufferSize,
                typeof(uint),
                587,
                @"[In GetPropList Request Type Success Response Body] AuxiliaryBufferSize (4 bytes): An unsigned integer that specifies the size, in bytes, of the AuxiliaryBuffer field.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R588");
        
            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R588
            this.Site.CaptureRequirementIfIsInstanceOfType(
                getPropListResponseBody.AuxiliaryBuffer,
                typeof(byte[]),
                588,
                @"[In GetPropList Request Type Success Response Body] AuxiliaryBuffer (variable): An array of bytes that constitute the auxiliary payload data returned from the server.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R589");
        
            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R589
            this.Site.CaptureRequirementIfAreEqual<uint>(
                getPropListResponseBody.AuxiliaryBufferSize,
                (uint)getPropListResponseBody.AuxiliaryBuffer.Length,
                589,
                @"[In GetPropList Request Type Success Response Body] [AuxiliaryBuffer] The size of this field, in bytes, is specified by the AuxiliaryBufferSize field.");
        }