protected internal IList <CalendarItemType> GetCalendarItems(ItemIdType[] itemIds) { if (itemIds.Length == 0) { return(new CalendarItemType[0]); } List <CalendarItemType> calendarItems = new List <CalendarItemType>(itemIds.Length); // Form the GetItem request. GetItemType getItemRequest = new GetItemType(); getItemRequest.ItemShape = new ItemResponseShapeType(); getItemRequest.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties; getItemRequest.ItemIds = itemIds; GetItemResponseType getItemResponse = Service.GetItem(getItemRequest); foreach (ItemInfoResponseMessageType responseMessage in getItemResponse.ResponseMessages.Items) { if (responseMessage.ResponseClass == ResponseClassType.Success && responseMessage.Items.Items != null && responseMessage.Items.Items.Length > 0) { calendarItems.Add((CalendarItemType)responseMessage.Items.Items[0]); } } return(calendarItems.ToArray()); }
/// <summary> /// Gets a specific message from exchange by id (attachments are only loaded shallow). /// </summary> /// <param name="messageId"></param> /// <returns></returns> public MessageType GetMessage(string messageId) { var binding = ChannelHelper.BuildChannel(hostname, username, password); ItemIdType itemId = new ItemIdType(); itemId.Id = messageId; GetItemType getItemRequest = new GetItemType(); getItemRequest.ItemShape = new ItemResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties }; getItemRequest.ItemIds = new[] { itemId }; GetItemResponseType getItemResponse = binding.GetItem(getItemRequest); if (getItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) { throw new Exception(getItemResponse.ResponseMessages.Items[0].MessageText); } var getItemResponseMessage = (ItemInfoResponseMessageType)getItemResponse.ResponseMessages.Items[0]; if (getItemResponseMessage.Items.Items == null || getItemResponseMessage.Items.Items.Length == 0) { throw new ApplicationException("Error in GetMessage, empty ItemInfoResponseMessageType"); } return((MessageType)getItemResponseMessage.Items.Items[0]); }
/// <summary> /// Get tasks on the server according to items' id. /// </summary> /// <param name="itemIds">The item id of task which will be gotten.</param> /// <returns>The got task items array.</returns> protected TaskType[] GetTasks(params ItemIdType[] itemIds) { GetItemType getItemRequest = TestSuiteHelper.GenerateGetItemRequest(itemIds); // Get the GetItem response from the server by using the ItemId got from createItem response. GetItemResponseType getItemResponse = this.TASKAdapter.GetItem(getItemRequest); this.VerifyResponseMessage(getItemResponse); return(Common.GetItemsFromInfoResponse <TaskType>(getItemResponse)); }
public void MSOXWSCORE_S08_TC01_CreateGetDeleteTypesOfItemsSuccessfully() { Site.Assume.IsTrue(Common.IsRequirementEnabled(19241, this.Site), "Exchange 2007 doesn't support MS-OXWSDLIST"); #region Step 1: Create Items. ItemIdType[] createdItemIds = CreateAllTypesItems(); #endregion #region Step 2: Get items GetItemResponseType getItemResponse = this.CallGetItemOperation(createdItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, createdItemIds.Length, this.Site); ItemIdType[] getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); #endregion #region Step3: Delete the item DeleteItemResponseType deleteItemResponse = this.CallDeleteItemOperation(); // Check the operation response. Common.CheckOperationSuccess(deleteItemResponse, createdItemIds.Length, this.Site); // Clear ExistItemIds for DeleteItem. this.InitializeCollection(); #endregion #region Step 4: Get deleted items getItemResponse = this.CallGetItemOperation(getItemIds); Site.Assert.AreEqual <int>( createdItemIds.Length, getItemResponse.ResponseMessages.Items.GetLength(0), "Expected Item Count: {0}, Actual Item Count: {1}", createdItemIds.Length, getItemResponse.ResponseMessages.Items.GetLength(0)); // Check whether the GetItem operation is executed failed with ErrorItemNotFound response code. foreach (ResponseMessageType responseMessage in getItemResponse.ResponseMessages.Items) { Site.Assert.AreEqual <ResponseClassType>( ResponseClassType.Error, responseMessage.ResponseClass, string.Format( "Get each types of items should succeed! Expected response code: {0}, actual response code: {1}", ResponseCodeType.ErrorItemNotFound, responseMessage.ResponseCode)); } #endregion }
/// <summary> /// Get items on the server. /// </summary> /// <param name="getItemRequest">Specify a request to get items on the server.</param> /// <returns>A response to this operation request.</returns> public GetItemResponseType GetItem(GetItemType getItemRequest) { if (getItemRequest == null) { throw new ArgumentException("The GetItem request should not be null."); } GetItemResponseType response = this.exchangeServiceBinding.GetItem(getItemRequest); return(response); }
/// <summary> /// Verify the WSDL port type specifications for the GetItem operation and GetItemResponseType structure. /// </summary> /// <param name="getItemResponse">The response got from server via GetItem operation.</param> /// <param name="isSchemaValidated">The result of schema validation, true means valid.</param> private void VerifyGetItemOperation(GetItemResponseType getItemResponse, bool isSchemaValidated) { // If the validation event returns any error or warning, the schema validation is false, // which indicates the schema is not matched with the expected result. // So this requirement can be verified when the isSchemaValidation is true. // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMSG_R116"); // Verify MS-OXWSMSG requirement: MS-OXWSMSG_R116 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 116, @"[In GetItem] The following is the WSDL port type specification of the GetItem operation.<wsdl:operation name=""GetItem""> <wsdl:input message=""tns:GetItemSoapIn"" /> <wsdl:output message=""tns:GetItemSoapOut"" /> </wsdl:operation>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMSG_R118"); // Verify MS-OXWSMSG requirement: MS-OXWSMSG_R118 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 118, @"[In GetItem] The following is the WSDL binding specification of the GetItem operation. <wsdl:operation name=""GetItem""> <soap:operation soapAction=""http://schemas.microsoft.com/exchange/services/2006/messages/GetItem"" /> <wsdl:input> <soap:header message=""tns:GetItemSoapIn"" part=""Impersonation"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""MailboxCulture"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""RequestVersion"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""TimeZoneContext"" use=""literal""/> <soap:body parts=""request"" use=""literal"" /> </wsdl:input> <wsdl:output> <soap:body parts=""GetItemResult"" use=""literal"" /> <soap:header message=""tns:GetItemSoapOut"" part=""ServerVersion"" use=""literal""/> </wsdl:output> </wsdl:operation>"); ItemInfoResponseMessageType item = getItemResponse.ResponseMessages.Items[0] as ItemInfoResponseMessageType; if (item.ResponseClass == ResponseClassType.Success) { if (item.Items.Items[0] is MessageType) { MessageType messageItem = item.Items.Items[0] as MessageType; this.VerifyMessageType(messageItem, isSchemaValidated); } } }
/// <summary> /// Get contact item on the server. /// </summary> /// <param name="getItemRequest">The request of GetItem operation.</param> /// <returns>A response to GetItem operation request.</returns> public GetItemResponseType GetItem(GetItemType getItemRequest) { GetItemResponseType getItemResponse = this.exchangeServiceBinding.GetItem(getItemRequest); Site.Assert.IsNotNull(getItemResponse, "If the operation is successful, the response should not be null."); #region Verify GetItem operation requirements this.VerifySoapVersion(); this.VerifyTransportType(); this.VerifyGetContactItem(getItemResponse, this.exchangeServiceBinding.IsSchemaValidated); #endregion return(getItemResponse); }
/// <summary> /// Get the calendar related item elements. /// </summary> /// <param name="request">A request to the GetItem operation.</param> /// <returns>The response message returned by GetItem operation.</returns> public GetItemResponseType GetItem(GetItemType request) { if (request == null) { throw new ArgumentException("The request of operation 'GetItem' should not be null."); } GetItemResponseType getItemResponse = this.exchangeServiceBinding.GetItem(request); Site.Assert.IsNotNull(getItemResponse, "If the operation is successful, the response should not be null."); this.VerifySoapVersion(); this.VerifyTransportType(); this.VerifyGetItemOperation(getItemResponse, this.exchangeServiceBinding.IsSchemaValidated); return(getItemResponse); }
/// <summary> /// Get items on the server. /// </summary> /// <param name="getItemRequest">Specify a request to get items on the server.</param> /// <returns>A response to GetItem operation request.</returns> public GetItemResponseType GetItem(GetItemType getItemRequest) { GetItemResponseType response = this.exchangeServiceBinding.GetItem(getItemRequest); Site.Assert.IsNotNull(response, "If the operation is successful, the response should not be null."); // SOAP version is set to 1.1, if a response can be received from server, then it means SOAP 1.1 is supported. this.VerifySoapVersion(); // Verify transport type related requirement. this.VerifyTransportType(); this.VerifyServerVersionInfo(this.exchangeServiceBinding.ServerVersionInfoValue, this.exchangeServiceBinding.IsSchemaValidated); this.VerifyGetItemResponse(response, this.exchangeServiceBinding.IsSchemaValidated); this.VerifyItemId(response); return(response); }
private CalendarItemType GetOccurrenceItem(Appointment master, int index) { ItemIdType masterItemId = new ItemIdType(); masterItemId.Id = master.Attributes[ExchangeIdAttribute]; masterItemId.ChangeKey = master.Attributes[ExchangeChangeKeyAttribute]; OccurrenceItemIdType occurrenceItemId = new OccurrenceItemIdType(); occurrenceItemId.RecurringMasterId = masterItemId.Id; occurrenceItemId.InstanceIndex = index; PathToUnindexedFieldType calendarItemTypePath = new PathToUnindexedFieldType(); calendarItemTypePath.FieldURI = UnindexedFieldURIType.calendarCalendarItemType; GetItemType getItemRequest = new GetItemType(); getItemRequest.ItemShape = new ItemResponseShapeType(); getItemRequest.ItemShape.BaseShape = DefaultShapeNamesType.IdOnly; getItemRequest.ItemShape.AdditionalProperties = new BasePathToElementType[] { calendarItemTypePath }; getItemRequest.ItemIds = new BaseItemIdType[] { masterItemId, occurrenceItemId }; GetItemResponseType getItemResponse = Service.GetItem(getItemRequest); CalendarItemType occurrenceItem = null; foreach (ItemInfoResponseMessageType getItemResponseMessage in getItemResponse.ResponseMessages.Items) { if (getItemResponseMessage.ResponseClass == ResponseClassType.Success && getItemResponseMessage.Items.Items != null && getItemResponseMessage.Items.Items.Length > 0) { occurrenceItem = (CalendarItemType)getItemResponseMessage.Items.Items[0]; } } if (occurrenceItem == null) { throw new Exception("Unable to find occurrence"); } return(occurrenceItem); }
public static GetItemResponseType GetItemRequest(string ItemID) { eBayAPIInterfaceService service = EbayCall.eBayServiceCall("GetItem"); GetItemRequestType request = new GetItemRequestType(); request.ItemID = ItemID; request.Version = "965"; request.IncludeItemSpecifics = true; request.DetailLevel = new DetailLevelCodeTypeCollection() { DetailLevelCodeType.ItemReturnDescription }; GetItemResponseType response = service.GetItem(request); //Console.WriteLine("====================================="); //Console.WriteLine("Item Iitle - {0}", response.Item.Title); //Console.WriteLine("Primary Category: {0}", response.Item.PrimaryCategory.CategoryName); //Console.WriteLine("====================================="); //Console.WriteLine("ItemID: {0}", response.Item.ItemID); //Console.WriteLine("Condition: {0}", response.Item.ConditionDisplayName); //Console.WriteLine("====================================="); //Console.WriteLine("Variation\n + {0}", string.Join("\n + ", response.Item.Variations.VariationSpecificsSet.ToArray().Select(x => x.Name + ": " + string.Join("| ", x.Value.ToArray())))); //Console.WriteLine("====================================="); //Console.WriteLine("Listing Duration: {0}", response.Item.ListingDuration); //Console.WriteLine("Start Price: {0} {1}", response.Item.StartPrice.Value, response.Item.Currency); //Console.WriteLine("Payment Type[0]: {0}", response.Item.PaymentMethods[0]); //Console.WriteLine("PayPal Email Address: {0}", response.Item.PayPalEmailAddress); //Console.WriteLine("Postal Code: {0}", response.Item.PostalCode); //Console.WriteLine("PictureURL:\n + {0}", string.Join("\n + ", response.Item.PictureDetails.PictureURL.ToArray())); //Console.WriteLine("====================================="); //Console.WriteLine("Item specifics\n + {0}", string.Join("\n + ", response.Item.ItemSpecifics.ToArray().Select(x => x.Name + ": " + string.Join("||", x.Value.ToArray())).ToList())); // ...Convert response object to JSON to see all return(response); }
public void MSOXWSCONT_S03_TC01_CopyContactItem() { #region Step 1:Create the contact item. // Create a contact item. ContactItemType item = this.BuildContactItemWithRequiredProperties(); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(item); // Check the response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); #endregion #region Step 2:Copy the contact item. CopyItemType copyItemRequest = new CopyItemType(); CopyItemResponseType copyItemResponse = new CopyItemResponseType(); // Configure ItemIds. copyItemRequest.ItemIds = new BaseItemIdType[1]; copyItemRequest.ItemIds[0] = this.ExistContactItems[0]; // Configure the copy Distinguished Folder. DistinguishedFolderIdType distinguishedFolderIdForCopyItem = new DistinguishedFolderIdType(); distinguishedFolderIdForCopyItem.Id = DistinguishedFolderIdNameType.drafts; copyItemRequest.ToFolderId = new TargetFolderIdType(); copyItemRequest.ToFolderId.Item = distinguishedFolderIdForCopyItem; copyItemResponse = this.CONTAdapter.CopyItem(copyItemRequest); // Check the response. Common.CheckOperationSuccess(copyItemResponse, 1, this.Site); #endregion #region Step 3:Get the contact item. // The contact item to get. ItemIdType[] itemArray = new ItemIdType[this.ExistContactItems.Count]; this.ExistContactItems.CopyTo(itemArray, 0); GetItemResponseType getItemResponse = this.CallGetItemOperation(itemArray); // Check the response. Common.CheckOperationSuccess(getItemResponse, 2, this.Site); #endregion }
/// <summary> /// Capture GetItemResponseType related requirements. /// </summary> /// <param name="getItemResponse">The response message of GetItem operation.</param> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyGetContactItem(GetItemResponseType getItemResponse, bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R114"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R114 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 114, @"[In GetItem] The following is the WSDL port type specification for the GetItem operation:<wsdl:operation name=""GetItem""> <wsdl:input message=""tns:GetItemSoapIn"" /> <wsdl:output message=""tns:GetItemSoapOut"" /> </wsdl:operation>"); ContactItemType[] contacts = Common.GetItemsFromInfoResponse<ContactItemType>(getItemResponse); foreach (ContactItemType contact in contacts) { // Capture ContactItemType Complex Type related requirements. this.VerifyContactItemTypeComplexType(contact, isSchemaValidated); } }
/// <summary> /// Capture GetItemResponseType related requirements. /// </summary> /// <param name="getItemResponse">The response message of GetItem operation.</param> /// <param name="isSchemaValidated">A boolean value indicates the schema validation result. True means the response conforms with the schema, false means not.</param> private void VerifyGetContactItem(GetItemResponseType getItemResponse, bool isSchemaValidated) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCONT_R114"); // Verify MS-OXWSCONT requirement: MS-OXWSCONT_R114 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 114, @"[In GetItem] The following is the WSDL port type specification for the GetItem operation:<wsdl:operation name=""GetItem""> <wsdl:input message=""tns:GetItemSoapIn"" /> <wsdl:output message=""tns:GetItemSoapOut"" /> </wsdl:operation>"); ContactItemType[] contacts = Common.GetItemsFromInfoResponse <ContactItemType>(getItemResponse); foreach (ContactItemType contact in contacts) { // Capture ContactItemType Complex Type related requirements. this.VerifyContactItemTypeComplexType(contact, isSchemaValidated); } }
/// <summary> /// Get the items information. /// </summary> /// <param name="itemIds">The array of item ids.</param> /// <returns>The items information.</returns> protected ItemType[] GetItems(BaseItemIdType[] itemIds) { GetItemType getItem = new GetItemType(); if (itemIds != null) { getItem.ItemIds = itemIds; getItem.ItemShape = new ItemResponseShapeType(); getItem.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties; } // Call GetItem operation GetItemResponseType getItemResponse = this.COREAdapter.GetItem(getItem); // Check whether the GetItem operation is executed successfully. foreach (ResponseMessageType responseMessage in getItemResponse.ResponseMessages.Items) { Site.Assert.AreEqual <ResponseClassType>( ResponseClassType.Success, responseMessage.ResponseClass, string.Format( "Get items should not be failed! Expected response code: {0}, actual response code: {1}", ResponseCodeType.NoError, responseMessage.ResponseCode)); } // If the operation executes successfully, the items in getItem response should be equal to the value of ItemCount. Site.Assert.AreEqual <int>( getItemResponse.ResponseMessages.Items.Length, this.ItemCount, string.Format( "The getItem response should contain {0} items, actually it contains {1}", this.ItemCount, getItemResponse.ResponseMessages.Items.Length)); // Get the items from successful response. ItemType[] getItems = Common.GetItemsFromInfoResponse <ItemType>(getItemResponse); return(getItems); }
private List <ZohoLead> GetBidderLead(List <ZohoLead> leads, GetItemResponseType item) { try { var lead = new ZohoLead() { ItemDescription = item.Item.Description, //PageViews = (int)item.Item.HitCount, //Watchers = (int)item.Item.WatchCount, UserId = item.Item.SellingStatus.HighBidder.UserID, EbayItemId = item.Item.ItemID, HighBidAmount = item.Item.SellingStatus.CurrentPrice.Value, TimeBid = item.Timestamp, Email = item.Item.SellingStatus.HighBidder.Email, FirstName = item.Item.SellingStatus.HighBidder.UserFirstName, LastName = item.Item.SellingStatus.HighBidder.UserLastName }; apiContext = GetApiContext(); GetItemCall call = new GetItemCall(apiContext); call.ItemID = item.Item.ItemID; call.IncludeWatchCount = true; call.DetailLevelList.Add(DetailLevelCodeType.ReturnAll); ItemType ebayItem = call.GetItem(item.Item.ItemID); lead.ItemDescription = ebayItem.Description; lead.PageViews = (int)ebayItem.HitCount; lead.Watchers = (int)ebayItem.WatchCount; leads.Add(lead); return(leads); } catch (Exception ex) { Trace.TraceError(ex.Message); throw ex; } }
public static void GetItemRequest(string itemID) { eBayAPIInterfaceService service = EbayCalls.EbayServiceCall("GetItem"); GetItemRequestType request = new GetItemRequestType(); request.Version = "949"; request.ItemID = itemID; GetItemResponseType response = service.GetItem(request); Console.WriteLine("======================="); Console.WriteLine("Item Title - {0}", response.Item.Title); Console.WriteLine("======================="); Console.WriteLine("ItemID: {0}", response.Item.ItemID); Console.WriteLine("Primary Category: {0}", response.Item.PrimaryCategory); Console.WriteLine("Listing Duration: {0}", response.Item.ListingDuration); Console.WriteLine("Start Price: {0}", response.Item.StartPrice); Console.WriteLine("Payment Type[0]: {0}", response.Item.PaymentMethods[0]); Console.WriteLine("PayPal Email Address: {0}", response.Item.PayPalEmailAddress); Console.WriteLine("Postal Code: {0}", response.Item.PostalCode); }
/// <summary> /// Retrieve item details. /// </summary> /// <param name="ItemID">eBay Item ID</param> public static void GetItemRequest(string ItemID) { eBayAPIInterfaceService service = EbayCalls.eBayServiceCall("GetItem"); GetItemRequestType request = new GetItemRequestType(); request.Version = "949"; request.ItemID = ItemID; GetItemResponseType response = service.GetItem(request); Console.WriteLine("====================================="); Console.WriteLine("Item Iitle - {0}", response.Item.Title); Console.WriteLine("====================================="); Console.WriteLine("ItemID: {0}", response.Item.ItemID); Console.WriteLine("Primary Category: {0}", response.Item.PrimaryCategory.CategoryName); Console.WriteLine("Listing Duration: {0}", response.Item.ListingDuration); Console.WriteLine("Start Price: {0} {1}", response.Item.StartPrice.Value, response.Item.Currency); Console.WriteLine("Payment Type[0]: {0}", response.Item.PaymentMethods[0]); Console.WriteLine("PayPal Email Address: {0}", response.Item.PayPalEmailAddress); Console.WriteLine("Postal Code: {0}", response.Item.PostalCode); // ...Convert response object to JSON to see all }
/// <summary> /// Gets the id and changekey of a specific message by id. /// </summary> /// <param name="messageId"></param> /// <returns></returns> public MessageType GetMessageId(string messageId) { var binding = ChannelHelper.BuildChannel(hostname, username, password); ItemIdType itemId = new ItemIdType(); itemId.Id = messageId; // Re-get item and changekey from exchange GetItemResponseType getItemResponse = binding.GetItem(new GetItemType { ItemShape = new ItemResponseShapeType { BaseShape = DefaultShapeNamesType.IdOnly }, ItemIds = new[] { itemId } }); if (getItemResponse.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error) { throw new Exception(getItemResponse.ResponseMessages.Items[0].MessageText); } return((MessageType)((ItemInfoResponseMessageType)getItemResponse.ResponseMessages.Items[0]).Items.Items[0]); }
public void MSOXWSCORE_S01_TC09_VerifyItemWithWithAllElement() { #region Step 1: Create the item. ItemType[] items = new ItemType[1]; items[0] = this.CreateFullPropertiesItem(); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(DistinguishedFolderIdNameType.inbox, items); // Check the operation response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); ItemIdType[] createdItemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); // One created item should be returned. Site.Assert.AreEqual<int>( 1, createdItemIds.GetLength(0), "One created item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, createdItemIds.GetLength(0)); #endregion #region Step 2: Get the item. GetItemType getItem = new GetItemType(); GetItemResponseType getItemResponse = new GetItemResponseType(); // The Item properties returned. getItem.ItemShape = new ItemResponseShapeType(); getItem.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties; List<PathToUnindexedFieldType> pathToUnindexedFields = new List<PathToUnindexedFieldType>(); if (Common.IsRequirementEnabled(1354, this.Site)) { PathToUnindexedFieldType pathToUnindexedField = new PathToUnindexedFieldType(); pathToUnindexedField.FieldURI = UnindexedFieldURIType.itemPreview; pathToUnindexedFields.Add(pathToUnindexedField); } if (Common.IsRequirementEnabled(1731, this.Site)) { PathToUnindexedFieldType pathToUnindexedField = new PathToUnindexedFieldType(); pathToUnindexedField.FieldURI = UnindexedFieldURIType.itemTextBody; pathToUnindexedFields.Add(pathToUnindexedField); } if (pathToUnindexedFields.Count > 0) { getItem.ItemShape.AdditionalProperties = pathToUnindexedFields.ToArray(); } // The item to get. getItem.ItemIds = createdItemIds; getItemResponse = this.COREAdapter.GetItem(getItem); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemType[] getItems = Common.GetItemsFromInfoResponse<ItemType>(getItemResponse); // One item should be returned. Site.Assert.AreEqual<int>( 1, getItems.GetLength(0), "One item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItems.GetLength(0)); Site.Assert.IsTrue(this.IsSchemaValidated, "The schema should be validated."); ItemIdType[] itemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); ItemIdId itemIdId = this.ITEMIDAdapter.ParseItemId(itemIds[0]); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSITEMID_R63"); // Verify MS-OXWSITEMID requirement: MS-OXWSITEMID_R63 Site.CaptureRequirementIfAreEqual<IdStorageType>( IdStorageType.MailboxItemMailboxGuidBased, itemIdId.StorageType, "MS-OXWSITEMID", 63, @"[In Id Storage Type (byte)] Its [Id Storage Type's] value maps to the following enumeration value. /// <summary> /// Indicates which type of storage is used for the item/folder represented by this Id. /// </summary> internal enum IdStorageType : byte { [ /// <summary> /// The Id represents an item or folder in a mailbox and /// it contains a primary SMTP address. /// </summary> MailboxItemSmtpAddressBased = 0, /// <summary> /// The Id represents a folder in a PublicFolder store. /// </summary> PublicFolder = 1, /// <summary> /// The Id represents an item in a PublicFolder store. /// </summary> PublicFolderItem = 2, ] /// <summary> /// The Id represents an item or folder in a mailbox and contains a mailbox GUID. /// </summary> MailboxItemMailboxGuidBased = 3, [ /// <summary> /// The Id represents a conversation in a mailbox and contains a mailbox GUID. /// </summary> ConversationIdMailboxGuidBased = 4, /// <summary> /// The Id represents (by objectGuid) an object in the Active Directory. /// </summary> ActiveDirectoryObject = 5,] }"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R156"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R156 this.Site.CaptureRequirementIfAreEqual<string>( createdItemIds[0].Id, getItems[0].ItemId.Id, 156, @"[In t:ItemIdType Complex Type] [The attribute ""Id""] Specifies an item identifier."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R298"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R298 // The created item was got successfully, so R298 can be captured. this.Site.CaptureRequirement( 298, @"[In m:CreateItemType Complex Type] [The element ""SavedItemFolderId""] Specifies the folder in which new items are saved."); #endregion #region Capture Code // Verify the ItemIdType. this.VerifyItemIdType(getItems[0].ItemId); // Verify the FolderIdType. this.VerifyFolderIdType(getItems[0].ParentFolderId); // Verify the ItemClassType. this.VerifyItemClassType(getItems[0].ItemClass, items[0].ItemClass); // Verify the Subject. this.VerifySubject(getItems[0].Subject, items[0].Subject); // Verify the SensitivityChoicesType. this.VerifySensitivityChoicesType(getItems[0].Sensitivity, items[0].Sensitivity); // Verify the BodyType. this.VerifyBodyType(getItems[0].Body, items[0].Body); // Verify the ArrayOfStringsType. this.VerifyArrayOfStringsType(getItems[0].Categories, items[0].Categories); // Verify the ImportanceChoicesType. this.VerifyImportanceChoicesType(getItems[0].ImportanceSpecified, getItems[0].Importance, items[0].Importance); // Verify the InReplyTo. this.VerifyInReplyTo(getItems[0].InReplyTo, items[0].InReplyTo); // Verify the NonEmptyArrayOfResponseObjectsType. this.VerifyNonEmptyArrayOfResponseObjectsType(getItems[0].ResponseObjects); // Verify the ReminderDueBy. this.VerifyReminderDueBy(getItems[0].ReminderDueBySpecified, getItems[0].ReminderDueBy, items[0].ReminderDueBy); // Verify the ReminderIsSet. this.VerifyReminderIsSet(getItems[0].ReminderIsSetSpecified); // Verify the DisplyTo. this.VerifyDisplayTo(getItems[0].DisplayTo); // Verify the DisplyCc. this.VerifyDisplayCc(getItems[0].DisplayCc); // Verify the Culture. this.VerifyCulture(getItems[0].Culture, items[0].Culture); // Verify the LastModifiedName. this.VerifyLastModifiedName(getItems[0].LastModifiedName, Common.GetConfigurationPropertyValue("User1Name", this.Site)); // Verify the EffectiveRightsType. this.VerifyEffectiveRightsType(getItems[0].EffectiveRights); // Verify the FlagType. this.VerifyFlagType(getItems[0].Flag); // Verify the Preview. this.VerifyPreview(getItems[0].Preview, getItems[0].Body.Value); // Verify the TextBody. this.VerifyTextBody(getItems[0].TextBody); // Verify the InstanceKey. this.VerifyInstanceKey(getItems[0].InstanceKey); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1315"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1315 Site.CaptureRequirementIfIsTrue( getItems[0].DateTimeReceivedSpecified, 1315, @"[In t:ItemType Complex Type] The type of DateTimeReceived is xs:dateTime [XMLSCHEMA2]."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1316"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1316 Site.CaptureRequirementIfIsTrue( getItems[0].SizeSpecified, 1316, @"[In t:ItemType Complex Type] The type of Size is xs:int [XMLSCHEMA2]."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1320"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1320 Site.CaptureRequirementIfIsTrue( getItems[0].IsSubmittedSpecified, 1320, @"[In t:ItemType Complex Type] The type of IsSubmitted is xs:boolean [XMLSCHEMA2]."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1607"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1607 Site.CaptureRequirementIfIsFalse( getItems[0].IsSubmitted, 1607, @"[In t:ItemType Complex Type] otherwise [IsSubmitted is] false, indicates [an item has not been submitted to the folder]."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1321"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1321 Site.CaptureRequirementIfIsTrue( getItems[0].IsDraftSpecified, 1321, @"[In t:ItemType Complex Type] The type of IsDraft is xs:boolean."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1322"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1322 Site.CaptureRequirementIfIsTrue( getItems[0].IsFromMeSpecified, 1322, @"[In t:ItemType Complex Type] The type of IsFromMe is xs:boolean."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1611"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1611 Site.CaptureRequirementIfIsFalse( getItems[0].IsFromMe, 1611, @"[In t:ItemType Complex Type] otherwise [IsFromMe is] false, indicates [a user does not sent an item to himself or herself]."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1323"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1323 Site.CaptureRequirementIfIsTrue( getItems[0].IsResendSpecified, 1323, @"[In t:ItemType Complex Type] The type of IsResend is xs:boolean."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1613"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1613 Site.CaptureRequirementIfIsFalse( getItems[0].IsResend, 1613, @"[In t:ItemType Complex Type] otherwise [IsResend is] false, indicates [an item has not previously been sent]."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1324"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1324 Site.CaptureRequirementIfIsTrue( getItems[0].IsUnmodifiedSpecified, 1324, @"[In t:ItemType Complex Type] The type of IsUnmodified is xs:boolean."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1326"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1326 Site.CaptureRequirementIfIsTrue( getItems[0].DateTimeSentSpecified, 1326, @"[In t:ItemType Complex Type] The type of DateTimeSent is xs:dateTime."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1327"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1327 Site.CaptureRequirementIfIsTrue( getItems[0].DateTimeCreatedSpecified, 1327, @"[In t:ItemType Complex Type] The type of DateTimeCreated is xs:dateTime."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1335"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1335 Site.CaptureRequirementIfIsTrue( getItems[0].HasAttachmentsSpecified, 1335, @"[In t:ItemType Complex Type] The type of HasAttachments is xs:boolean."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1340"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1340 Site.CaptureRequirementIfIsTrue( getItems[0].LastModifiedTimeSpecified, 1340, @"[In t:ItemType Complex Type] The type of LastModifiedTime is xs:dateTime."); // Verify the ReminderMinutesBeforeStartType schema. this.VerifyReminderMinutesBeforeStartType(getItems[0].ReminderMinutesBeforeStart, items[0].ReminderMinutesBeforeStart); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R105"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R105 // The LastModifiedTimeSpecified is true, so this requirement can be captured. this.Site.CaptureRequirementIfIsTrue( getItems[0].LastModifiedTimeSpecified, 105, @"[In t:ItemType Complex Type] [The element ""LastModifiedTime""] Specifies an instance of the DateTime structure that represents the date and time when an item was last modified."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R78"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R78 // The DateTimeReceivedSpecified is true, so this requirement can be captured. this.Site.CaptureRequirementIfIsTrue( getItems[0].DateTimeReceivedSpecified, 78, @"[In t:ItemType Complex Type] [The element ""DateTimeReceived""] Specifies the date and time that an item was received in a mailbox."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R79"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R79 // The SizeSpecified is true, so this requirement can be captured. this.Site.CaptureRequirementIfIsTrue( getItems[0].SizeSpecified, 79, @"[In t:ItemType Complex Type] [The element ""Size""] Specifies an integer value that represents the size of an item, in bytes."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R89"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R89 // The DateTimeSentSpecified is true, so this requirement can be captured. this.Site.CaptureRequirementIfIsTrue( getItems[0].DateTimeSentSpecified, 89, @"[In t:ItemType Complex Type] [The element ""DateTimeSent""] Specifies the date and time when an item in a mailbox was sent."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R90"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R90 // The DateTimeCreatedSpecified is true, so this requirement can be captured. this.Site.CaptureRequirementIfIsTrue( getItems[0].DateTimeCreatedSpecified, 90, @"[In t:ItemType Complex Type] [The element ""DateTimeCreated""] Specifies the date and time when an item in a mailbox was created."); if (Common.IsRequirementEnabled(4003, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R4003"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R4003 // The IsTruncated is set and the item is created successfully, so this requirement can be captured. this.Site.CaptureRequirement( "MS-OXWSCDATA", 4003, @"[In Appendix C: Product Behavior] Implementation does use the attribute ""IsTruncated"" with type ""xs:boolean ([XMLSCHEMA2])"" which specifies whether the body is truncated. (Exchange 2013 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(1353, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1353"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1353 // The RetentionDate is set and the item is created successfully, so this requirement can be captured. this.Site.CaptureRequirement( 1353, @"[In Appendix C: Product Behavior] Implementation does support element ""RetentionDate"" with type ""xs:dateTime"" which specifies the retention date for an item. (Exchange 2013 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(2281, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1314"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1314 // The Attachments is set and the item is created successfully, so this requirement can be captured. this.Site.CaptureRequirement( 1314, @"[In t:ItemType Complex Type] The type of Attachments is t:NonEmptyArrayOfAttachmentsType ([MS-OXWSCDATA] section 2.2.4.43)."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2281"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2281 // The Attachments is set and the item is created successfully, so this requirement can be captured. this.Site.CaptureRequirement( 2281, @"[In Appendix C: Product Behavior] Implementation does use the Attachments element which specifies an array of items or files that are attached to an item. (Exchange 2010 SP2 and above follow this behavior.)"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1620"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1620 this.Site.CaptureRequirementIfIsTrue( getItems[0].HasAttachmentsSpecified && getItems[0].HasAttachments, 1620, @"[In t:ItemType Complex Type] [HasAttachments is] True, indicates an item has at least one attachment."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R1229"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R1229 this.Site.CaptureRequirement( "MS-OXWSCDATA", 1229, @"[In t:NonEmptyArrayOfAttachmentsType Complex Type] The type [NonEmptyArrayOfAttachmentsType] is defined as follow: <xs:complexType name=""NonEmptyArrayOfAttachmentsType""> <xs:choice minOccurs=""1"" maxOccurs=""unbounded"" > <xs:element name=""ItemAttachment"" type=""t:ItemAttachmentType"" /> <xs:element name=""FileAttachment"" type=""t:FileAttachmentType"" /> </xs:choice> </xs:complexType>"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R1633"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R1633 // The item was created with an item attachment. this.Site.CaptureRequirement( "MS-OXWSCDATA", 1633, @"[In t:NonEmptyArrayOfAttachmentsType Complex Type] The element ""ItemAttachment"" is ""t:ItemAttachmentType"" type."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCDATA_R1634"); // Verify MS-OXWSCORE requirement: MS-OXWSCDATA_R1634 // The item was created with an file attachment. this.Site.CaptureRequirement( "MS-OXWSCDATA", 1634, @"[In t:NonEmptyArrayOfAttachmentsType Complex Type] The element ""FileAttachment"" is ""t:FileAttachmentType"" type."); } if (Common.IsRequirementEnabled(2285, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2285"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2285 this.Site.CaptureRequirementIfIsTrue( getItems[0].IsAssociatedSpecified, 2285, @"[In Appendix C: Product Behavior] Implementation does support the IsAssociated element which specifies a value that indicates whether the item is associated with a folder. (Exchange 2010 and above follow this behavior.)"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1619"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1619 this.Site.CaptureRequirementIfIsFalse( getItems[0].IsAssociated, 1619, @"[In t:ItemType Complex Type] otherwise [IsAssociated is] false, indicates [the item is associated with a folder]."); } if (Common.IsRequirementEnabled(2338, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2338"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2338 this.Site.CaptureRequirementIfIsNotNull( getItems[0].WebClientReadFormQueryString, 2338, @"[In Appendix C: Product Behavior] Implementation does support the WebClientReadFormQueryString element. (Exchange Server 2010 and above follow this behavior.)"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1342"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1342 // The WebClientReadFormQueryString is returned from server and pass the schema validation, so this requirement can be captured. this.Site.CaptureRequirement( 1342, @"[In t:ItemType Complex Type] The type of WebClientReadFormQueryString is xs:string."); } if (Common.IsRequirementEnabled(2283, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2283"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2283 this.Site.CaptureRequirementIfIsTrue( getItems[0].ReminderNextTimeSpecified, 2283, @"[In Appendix C: Product Behavior] Implementation does support the ReminderNextTime element which specifies the date and time for the next reminder. (Exchange 2013 and above follow this behavior.)"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1727"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1727 // The ReminderNextTime is returned from server and pass the schema validation, so this requirement can be captured. this.Site.CaptureRequirement( 1727, @"[In t:ItemType Complex Type] The type of ReminderNextTime is xs:dateTime."); } if (Common.IsRequirementEnabled(2288, this.Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2288"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2288 this.Site.CaptureRequirementIfIsNotNull( getItems[0].ConversationId, 2288, @"[In Appendix C: Product Behavior] Implementation does support the element ""ConversationId"" which specifies the ID of the conversation that an item is part of.. (Exchange 2010 and above follow this behavior.)"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1344"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1344 // The ConversationId is returned from server and pass the schema validation, so this requirement can be captured. this.Site.CaptureRequirement( 1344, @"[In t:ItemType Complex Type] The type of ConversationId is t:ItemIdType."); } #endregion }
public void MSOXWSCORE_S03_TC03_MoveDistributionListsItemSuccessfully() { Site.Assume.IsTrue(Common.IsRequirementEnabled(19241, this.Site), "Exchange 2007 doesn't support MS-OXWSDLIST"); #region Step 1: Create the distribution list type item. DistributionListType item = new DistributionListType(); ItemIdType[] createdItemIds = this.CreateItemWithMinimumElements(item); #endregion #region Step 2: Move the distribution list type item. // Clear ExistItemIds for MoveItem. this.InitializeCollection(); // Call MoveItem operation. MoveItemResponseType moveItemResponse = this.CallMoveItemOperation(DistinguishedFolderIdNameType.inbox, createdItemIds); // Check the operation response. Common.CheckOperationSuccess(moveItemResponse, 1, this.Site); ItemIdType[] movedItemIds = Common.GetItemIdsFromInfoResponse(moveItemResponse); // One moved distribution list type item should be returned. Site.Assert.AreEqual <int>( 1, movedItemIds.GetLength(0), "One moved distribution list type item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, movedItemIds.GetLength(0)); #endregion #region Step 3: Get the created distribution list type item failed. // Call the GetItem operation. GetItemResponseType getItemResponse = this.CallGetItemOperation(createdItemIds); Site.Assert.AreEqual <int>( 1, getItemResponse.ResponseMessages.Items.GetLength(0), "Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemResponse.ResponseMessages.Items.GetLength(0)); Site.Assert.AreEqual <ResponseClassType>( ResponseClassType.Error, getItemResponse.ResponseMessages.Items[0].ResponseClass, string.Format( "Get distribution list type item operation should be failed with error! Actual response code: {0}", getItemResponse.ResponseMessages.Items[0].ResponseCode)); #endregion #region Step 4: Get the moved distribution list type item. // Call the GetItem operation. getItemResponse = this.CallGetItemOperation(movedItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemIdType[] getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One distribution list type item should be returned. Site.Assert.AreEqual <int>( 1, getItemIds.GetLength(0), "One distribution list type item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); #endregion }
public void MSOXWSCONT_S04_TC01_MoveContactItem() { #region Step 1:Create the contact item. // Create a contact item. ContactItemType item = this.BuildContactItemWithRequiredProperties(); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(item); // Check the response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); ItemIdType[] createdItemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); #endregion #region Step 2:Move the contact item. MoveItemType moveItemRequest = new MoveItemType(); MoveItemResponseType moveItemResponse = new MoveItemResponseType(); // Configure ItemIds. moveItemRequest.ItemIds = new BaseItemIdType[1]; moveItemRequest.ItemIds[0] = this.ExistContactItems[0]; // Clear existContactItems for MoveItem. this.InitializeCollection(); // Configure move Distinguished Folder. DistinguishedFolderIdType distinguishedFolderId = new DistinguishedFolderIdType(); distinguishedFolderId.Id = DistinguishedFolderIdNameType.drafts; moveItemRequest.ToFolderId = new TargetFolderIdType(); moveItemRequest.ToFolderId.Item = distinguishedFolderId; moveItemResponse = this.CONTAdapter.MoveItem(moveItemRequest); // Check the response. Common.CheckOperationSuccess(moveItemResponse, 1, this.Site); #endregion #region Step 3:Get the moved contact item. // The contact item to get. ItemIdType[] itemArray = new ItemIdType[this.ExistContactItems.Count]; this.ExistContactItems.CopyTo(itemArray, 0); GetItemResponseType getItemResponse = this.CallGetItemOperation(itemArray); // Check the response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); #endregion #region Step 4:Get the original contact item Id. // Call GetItem operation. getItemResponse = this.CallGetItemOperation(createdItemIds); Site.Assert.AreEqual <int>( 1, getItemResponse.ResponseMessages.Items.GetLength(0), "Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemResponse.ResponseMessages.Items.GetLength(0)); Site.Assert.AreEqual <ResponseCodeType>( ResponseCodeType.ErrorItemNotFound, getItemResponse.ResponseMessages.Items[0].ResponseCode, string.Format( "Get contact item with original item Id should fail! Expected response code: {0}, actual response code: {1}", ResponseCodeType.ErrorItemNotFound, getItemResponse.ResponseMessages.Items[0].ResponseCode)); #endregion }
public void MSOXWSCORE_S07_TC03_MoveTaskItemSuccessfully() { #region Step 1: Create the task item. TaskType item = new TaskType(); ItemIdType[] createdItemIds = this.CreateItemWithMinimumElements(item); #endregion #region Step 2: Move the task item. // Clear ExistItemIds for MoveItem. this.InitializeCollection(); // Call MoveItem operation. MoveItemResponseType moveItemResponse = this.CallMoveItemOperation(DistinguishedFolderIdNameType.inbox, createdItemIds); // Check the operation response. Common.CheckOperationSuccess(moveItemResponse, 1, this.Site); ItemIdType[] movedItemIds = Common.GetItemIdsFromInfoResponse(moveItemResponse); // One moved task item should be returned. Site.Assert.AreEqual <int>( 1, movedItemIds.GetLength(0), "One moved task item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, movedItemIds.GetLength(0)); #endregion #region Step 3: Get the created task item failed. // Call the GetItem operation. GetItemResponseType getItemResponse = this.CallGetItemOperation(createdItemIds); Site.Assert.AreEqual <int>( 1, getItemResponse.ResponseMessages.Items.GetLength(0), "Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemResponse.ResponseMessages.Items.GetLength(0)); Site.Assert.AreEqual <ResponseClassType>( ResponseClassType.Error, getItemResponse.ResponseMessages.Items[0].ResponseClass, string.Format( "Get task item operation should be failed with error! Actual response code: {0}", getItemResponse.ResponseMessages.Items[0].ResponseCode)); #endregion #region Step 4: Get the moved task item. // Call the GetItem operation. getItemResponse = this.CallGetItemOperation(movedItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemIdType[] getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One task item should be returned. Site.Assert.AreEqual <int>( 1, getItemIds.GetLength(0), "One task item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); #endregion }
public void MSOXWSCORE_S03_TC02_CopyDistributionListsItemSuccessfully() { Site.Assume.IsTrue(Common.IsRequirementEnabled(19241, this.Site), "Exchange 2007 doesn't support MS-OXWSDLIST"); #region Step 1: Create the distribution list type item. DistributionListType item = new DistributionListType(); ItemIdType[] createdItemIds = this.CreateItemWithMinimumElements(item); #endregion #region Step 2: Copy the distribution list type item. // Call CopyItem operation. CopyItemResponseType copyItemResponse = this.CallCopyItemOperation(DistinguishedFolderIdNameType.drafts, createdItemIds); // Check the operation response. Common.CheckOperationSuccess(copyItemResponse, 1, this.Site); ItemIdType[] copiedItemIds = Common.GetItemIdsFromInfoResponse(copyItemResponse); // One copied distribution list type item should be returned. Site.Assert.AreEqual <int>( 1, copiedItemIds.GetLength(0), "One copied distribution list type item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, copiedItemIds.GetLength(0)); #endregion #region Step 3: Get the first created distribution list type item success. // Call the GetItem operation. GetItemResponseType getItemResponse = this.CallGetItemOperation(createdItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemIdType[] getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One distribution list type item should be returned. Site.Assert.AreEqual <int>( 1, getItemIds.GetLength(0), "One distribution list type item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2022"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2022 this.Site.CaptureRequirementIfAreEqual <string>( "IPM.DistList", ((ItemInfoResponseMessageType)getItemResponse.ResponseMessages.Items[0]).Items.Items[0].ItemClass, 2022, @"[In t:ItemType Complex Type] This value is ""IPM.DistList"" for distribution list item."); #endregion #region Step 4: Get the second copied distribution list type item success. // Call the GetItem operation. getItemResponse = this.CallGetItemOperation(copiedItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One distribution list type item should be returned. Site.Assert.AreEqual <int>( 1, getItemIds.GetLength(0), "One distribution list type item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); #endregion }
public void MSOXWSMSG_S02_TC01_UpdateMessage() { #region Create message CreateItemType createItemRequest = GetCreateItemType(MessageDispositionType.SaveOnly, DistinguishedFolderIdNameType.drafts); CreateItemResponseType createItemResponse = this.MSGAdapter.CreateItem(createItemRequest); Site.Assert.IsTrue(this.VerifyCreateItemResponse(createItemResponse, MessageDispositionType.SaveOnly), @"Server should return success for creating the email messages."); this.infoItems = TestSuiteHelper.GetInfoItemsInResponse(createItemResponse); this.firstItemOfFirstInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 0, 0); // Save the ItemId of message responseMessageItem returned from the createItem response. ItemIdType itemIdType = new ItemIdType(); Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem.ItemId, @"The ItemId property of the first item should not be null."); itemIdType.Id = this.firstItemOfFirstInfoItem.ItemId.Id; itemIdType.ChangeKey = this.firstItemOfFirstInfoItem.ItemId.ChangeKey; #endregion #region update ToRecipients property of the original message UpdateItemType updateItemRequest = new UpdateItemType { MessageDisposition = MessageDispositionType.SaveOnly, MessageDispositionSpecified = true, ItemChanges = new ItemChangeType[] { new ItemChangeType { Item = itemIdType, Updates = new ItemChangeDescriptionType[] { new SetItemFieldType { Item = new PathToUnindexedFieldType { FieldURI = UnindexedFieldURIType.messageToRecipients }, // Update the ToRecipients of message from Recipient1 to Recipient2. Item1 = new MessageType { ToRecipients = new EmailAddressType[] { new EmailAddressType { EmailAddress = this.Recipient2 } } } } } } } }; UpdateItemResponseType updateItemResponse = this.MSGAdapter.UpdateItem(updateItemRequest); Site.Assert.IsTrue(this.VerifyResponse(updateItemResponse), @"Server should return success for creating the email messages."); this.infoItems = TestSuiteHelper.GetInfoItemsInResponse(createItemResponse); this.firstItemOfFirstInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 0, 0); Site.Assert.IsNotNull(this.infoItems, @"InfoItems in the returned response should not be null."); Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem, @"The first item of the array of ItemType type returned from server response should not be null."); // Save the ItemId of message responseMessageItem got from the UpdateItem response. if (this.firstItemOfFirstInfoItem != null) { Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem.ItemId, @"The ItemId property of the first item should not be null."); itemIdType.Id = this.firstItemOfFirstInfoItem.ItemId.Id; itemIdType.ChangeKey = this.firstItemOfFirstInfoItem.ItemId.ChangeKey; } #region Verify the requirements about UpdateItem // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMSG_R143"); // Verify MS-OXWSMSG requirement: MS-OXWSMSG_R143 Site.CaptureRequirementIfIsNotNull( updateItemResponse, 143, @"[In UpdateItem] The protocol client sends an UpdateItemSoapIn request WSDL message, and the protocol server responds with an UpdateItemSoapOut response WSDL message."); Site.Assert.IsNotNull(this.infoItems[0].ResponseClass, @"The ResponseClass property of the first item of infoItems instance should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMSG_R144"); // Verify MS-OXWSMSG requirement: MS-OXWSMSG_R144 Site.CaptureRequirementIfAreEqual <ResponseClassType>( ResponseClassType.Success, this.infoItems[0].ResponseClass, 144, @"[In UpdateItem] If the UpdateItem WSDL operation request is successful, the server returns an UpdateItemResponse element, as specified in [MS-OXWSCORE] section 3.1.4.9.2.2, with the ResponseClass attribute, as specified in [MS-OXWSCDATA] section 2.2.4.67, of the UpdateItemResponseMessage element, as specified in [MS-OXWSCDATA] section 2.2.4.12, set to ""Success"". "); Site.Assert.IsNotNull(this.infoItems[0].ResponseCode, @"The ResponseCode property of the first item of infoItems instance should not be null."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMSG_R145"); // Verify MS-OXWSMSG requirement: MS-OXWSMSG_R145 Site.CaptureRequirementIfAreEqual <ResponseCodeType>( ResponseCodeType.NoError, this.infoItems[0].ResponseCode, 145, @"[In UpdateItem] [A successful UpdateItem operation request returns an UpdateItemResponse element] The ResponseCode element, as specified in [MS-OXWSCDATA] section 2.2.4.67, of the UpdateItemResponseMessage element is set to ""NoError"". "); #endregion #endregion #region Get the updated message GetItemType getItemRequest = DefineGeneralGetItemRequestMessage(itemIdType, DefaultShapeNamesType.AllProperties); GetItemResponseType getItemResponse = this.MSGAdapter.GetItem(getItemRequest); Site.Assert.IsTrue(this.VerifyResponse(getItemResponse), @"Server should return success for getting the email messages."); this.infoItems = TestSuiteHelper.GetInfoItemsInResponse(getItemResponse); Site.Assert.IsNotNull(this.infoItems, @"The GetItem response should contain one or more items of ItemInfoResponseMessageType."); ItemType updatedItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 0, 0); Site.Assert.IsNotNull(updatedItem, @"The updated message should exist"); string expectedValue = Common.GetConfigurationPropertyValue("Recipient2", this.Site); Site.Assert.AreEqual <string>( expectedValue.ToLower(), updatedItem.DisplayTo.ToLower(), string.Format("The expected value of the DisplayTo property is {0}. The actual value is {1}.", expectedValue, updatedItem.DisplayTo)); #endregion #region Clean up Sender's drafts folder bool isClear = this.MSGSUTControlAdapter.CleanupFolders( Common.GetConfigurationPropertyValue("Sender", this.Site), Common.GetConfigurationPropertyValue("SenderPassword", this.Site), this.Domain, this.Subject, "drafts"); Site.Assert.IsTrue(isClear, "Sender's drafts folder should be cleaned up."); #endregion }
/// <summary> /// Call GetItem operation. /// </summary> /// <param name="itemIds">The ItemIds to be gotten.</param> /// <returns>The GetItem response.</returns> protected GetItemResponseType CallGetItemOperation(ItemIdType[] itemIds) { GetItemType getItem = new GetItemType(); GetItemResponseType getItemResponse = new GetItemResponseType(); // Set the ItemShape property of GetItem operation's request getItem.ItemShape = new ItemResponseShapeType(); getItem.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties; // The contact item to get. getItem.ItemIds = itemIds; getItemResponse = this.CONTAdapter.GetItem(getItem); return getItemResponse; }
public void MSOXWSCORE_S07_TC17_GetTaskItemWithIconIndexSuccessfully() { Site.Assume.IsTrue(Common.IsRequirementEnabled(1917, this.Site), "Exchange 2007 and Exchange 2010 do not support the IconIndex element."); #region Step 1: Create a recurring task item. // Define the pattern and range of the recurring task item. DailyRecurrencePatternType pattern = new DailyRecurrencePatternType(); pattern.Interval = 1; NumberedRecurrenceRangeType range = new NumberedRecurrenceRangeType(); range.NumberOfOccurrences = 5; range.StartDate = System.DateTime.Now; // Define the TaskType item. TaskType[] items = new TaskType[] { new TaskType() }; items[0].Subject = Common.GenerateResourceName( this.Site, TestSuiteHelper.SubjectForCreateItem); items[0].Recurrence = new TaskRecurrenceType(); items[0].Recurrence.Item = pattern; items[0].Recurrence.Item1 = range; // Call CreateItem operation. CreateItemResponseType createItemResponse = this.CallCreateItemOperation(DistinguishedFolderIdNameType.tasks, items); // Check the operation response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); BaseItemIdType[] createdTaskItemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); // One created task item should be returned. Site.Assert.AreEqual <int>( 1, createdTaskItemIds.GetLength(0), "One created task item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, createdTaskItemIds.GetLength(0)); #endregion #region Step 2: Get the recurring task item by ItemIdType. GetItemType getItem = new GetItemType(); // Create item and return the item id. getItem.ItemIds = createdTaskItemIds; // Set the item shape's elements. getItem.ItemShape = new ItemResponseShapeType(); getItem.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties; getItem.ItemShape.AdditionalProperties = new PathToUnindexedFieldType[] { new PathToUnindexedFieldType() { FieldURI = UnindexedFieldURIType.itemIconIndex } }; // Call GetItem operation using the created task item ID. GetItemResponseType getItemResponse = this.COREAdapter.GetItem(getItem); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); #endregion #region Step 3: Assert the value of IconIndex element is "TaskRecur". TaskType[] taskItems = Common.GetItemsFromInfoResponse <TaskType>(getItemResponse); // One created item should be returned. Site.Assert.AreEqual <int>( 1, taskItems.GetLength(0), "One item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, taskItems.GetLength(0)); Site.Assert.IsTrue(this.IsSchemaValidated, "The schema should be validated."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1917"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1917 this.Site.CaptureRequirementIfAreEqual <IconIndexType>( IconIndexType.TaskRecur, taskItems[0].IconIndex, 1917, @"[In Appendix C: Product Behavior] Implementation does support value ""TaskRecur"" of ""IconIndex"" simple type which specifies the recurring task icon. (Exchange 2013 and above follow this behavior.)"); #endregion }
/// <summary> /// Verify the GetItemResponseType structure. /// </summary> /// <param name="getItemResponse">A GetItemResponseType instance.</param> /// <param name="isSchemaValidated">Indicate whether schema is verified.</param> private void VerifyGetItemResponse(GetItemResponseType getItemResponse, bool isSchemaValidated) { Site.Assert.IsTrue(isSchemaValidated, "The schema should be validated."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R347"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R347 Site.CaptureRequirementIfIsNotNull( getItemResponse, 347, @"[In GetItem Operation] The following is the WSDL port type specification for the GetItem operation: <wsdl:operation name=""GetItem""> <wsdl:input message=""tns:GetItemSoapIn""/> <wsdl:output message=""tns:GetItemSoapOut""/> </wsdl:operation>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R348"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R348 Site.CaptureRequirementIfIsNotNull( getItemResponse, 348, @"[In GetItem Operation] The following is the WSDL binding specification for the GetItem operation: <wsdl:operation name=""GetItem""> <soap:operation soapAction=""http://schemas.microsoft.com/exchange/services/2006/messages/GetItem""/> <wsdl:input> <soap:header message=""tns:GetItemSoapIn"" part=""Impersonation"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""MailboxCulture"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""RequestVersion"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""TimeZoneContext"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""DateTimePrecision"" use=""literal"" /> <soap:body parts=""request"" use=""literal""/> </wsdl:input> <wsdl:output> <soap:body parts=""GetItemResult"" use=""literal""/> <soap:header message=""tns:GetItemSoapOut"" part=""ServerVersion"" use=""literal""/> </wsdl:output> </wsdl:operation>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R364"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R364 Site.CaptureRequirementIfIsNotNull( getItemResponse, 364, @"[In tns:GetItemSoapOut Message] [The GetItemSoapOut WSDL message is defined as:] <wsdl:message name=""GetItemSoapOut""> <wsdl:part name=""GetItemResult"" element=""tns:GetItemResponse""/> <wsdl:part name=""ServerVersion"" element=""t:ServerVersionInfo""/> </wsdl:message>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R375"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R375 Site.CaptureRequirementIfIsNotNull( getItemResponse, 375, @"[In m:GetItemResponse Element] [The GetItemResponse element is defined as:] <xs:element name=""GetItemResponse"" type=""m:GetItemResponseType"" />"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R381"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R381 Site.CaptureRequirementIfIsNotNull( getItemResponse, 381, @"[In m:GetItemResponseType Complex Type] [The GetItemResponseType complex type is defined as:] <xs:complexType name=""GetItemResponseType""> <xs:complexContent> <xs:extension base=""m:BaseResponseMessageType"" /> </xs:complexContent> </xs:complexType>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1434"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1434 Site.CaptureRequirementIfIsNotNull( getItemResponse, 1434, @"[In tns:GetItemSoapOut Message] The type of GetItemResult is tns:GetItemResponse (section 3.1.4.4.2.2)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R386"); // The ItemShape element is a required element in request, the response shape is determined by this element, and if the response is not null, // this requirement is validated. Site.CaptureRequirementIfIsNotNull( getItemResponse, 386, @"[In m:GetItemType Complex Type] [The element ""ItemShape""] Specifies the response shape of a GetItem operation response."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R367"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R367 // According to the schema, getItemResponse is the SOAP body of a response message returned by server, // this requirement can be verified directly. Site.CaptureRequirement( 367, @"[In tns:GetItemSoapOut Message] [The part ""GetItemResult""] Specifies the SOAP body of a response message."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1435"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1435 Site.CaptureRequirementIfIsNotNull( this.exchangeServiceBinding.ServerVersionInfoValue, 1435, @"[In tns:GetItemSoapOut Message] The type of ServerVersion is t:ServerVersionInfo ([MS-OXWSCDATA] section 2.2.5.10)."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R368"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R368 // According to the schema, ServerVersion is the SOAP header that contains the server version information, // this requirement can be verified directly. Site.CaptureRequirement( 368, @"[In tns:GetItemSoapOut Message] [The part ""ServerVersion""] Specifies a SOAP header that identifies the server version for a response."); // Verify the BaseResponseMessageType schema. this.VerifyBaseResponseMessageType(getItemResponse); foreach (ItemInfoResponseMessageType info in getItemResponse.ResponseMessages.Items) { this.VerifyItemInfoResponseMessageType(info); if (Common.IsRequirementEnabled(2313, this.Site) && this.exchangeServiceBinding.TimeZoneContext != null && this.exchangeServiceBinding.TimeZoneContext.TimeZoneDefinition != null && this.exchangeServiceBinding.TimeZoneContext.TimeZoneDefinition.Id == "Pacific Standard Time") { string innerXml = this.exchangeServiceBinding.LastRawResponseXml.CreateNavigator().InnerXml; string temp = innerXml.Substring(innerXml.IndexOf("DateTimeCreated")); string dateTimeCreated = temp.Substring(temp.IndexOf(">") + 1, temp.IndexOf("<") - temp.IndexOf(">") - 1); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R361"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R361 Site.CaptureRequirementIfIsTrue( dateTimeCreated.Contains(System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId(info.Items.Items[0].DateTimeCreated, "Pacific Standard Time").GetDateTimeFormats('s')[0]), 361, @"[In tns:GetItemSoapIn Message] [The part ""TimeZoneContext""] Specifies a SOAP header that identifies the time zone to be used for all responses from the server."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2313"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2313 Site.CaptureRequirementIfIsTrue( dateTimeCreated.Contains(System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId(info.Items.Items[0].DateTimeCreated, "Pacific Standard Time").GetDateTimeFormats('s')[0]), 2313, @"[In Appendix C: Product Behavior] Implementation does convert the times in GetItem response even if the TimeZoneContext SOAP header is set in request. (Exchange 2010 and above follow this behavior.) "); } } // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R215"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R215 // The request of GetItem operation is formed according to schema // And the response of GetItem operation is returned by server according to schema // This requirement can be verified directly. Site.CaptureRequirement( 215, @"[In Message Processing Events and Sequencing Rules] [The operation ""GetItem""] Gets items on the server."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R346"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R346 // Items are returned in ItemInfoResponseMessageType, if ItemInfoResponseMessageType is verified, this requirement can be verified. Site.CaptureRequirement( 346, @"[In GetItem Operation] The GetItem operation gets items on the server."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R371"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R371 // This requirement can be captured directly, since DeleteItemResponse is the response of a DeleteItem operation request. Site.CaptureRequirement( 371, @"[In Elements] [The element ""GetItemResponse""] Specifies a response to a GetItem operation request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R374"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R374 // This requirement can be captured directly, since DeleteItemResponse is the response of a DeleteItem operation request. Site.CaptureRequirement( 374, @"[In m:GetItemResponse Element] The GetItemResponse element specifies a response to a GetItem operation request."); }
public ResultInfoEbayItemInfo(GetItemResponseType response) : base(response) { _Response = response; }
public void MSOXWSCONT_S02_TC01_UpdateContactItem() { #region Step 1:Create the contact item. // Create a contact item. ContactItemType item = this.BuildContactItemWithRequiredProperties(); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(item); // Check the response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); #endregion #region Step 2:Update the contact item. UpdateItemType updateItemRequest = new UpdateItemType() { // Configure ItemIds. ItemChanges = new ItemChangeType[] { new ItemChangeType() { Item = this.ExistContactItems[0], Updates = new ItemChangeDescriptionType[] { new SetItemFieldType() { Item = new PathToUnindexedFieldType() { FieldURI = UnindexedFieldURIType.contactsFileAs }, Item1 = new ContactItemType() { FileAs = FileAsMappingType.LastFirstCompany.ToString() } } } } }, ConflictResolution = ConflictResolutionType.AlwaysOverwrite }; UpdateItemResponseType updateItemResponse = new UpdateItemResponseType(); // Invoke UpdateItem operation. updateItemResponse = this.CONTAdapter.UpdateItem(updateItemRequest); // Check the response. Common.CheckOperationSuccess(updateItemResponse, 1, this.Site); #endregion #region Step 3:Get the contact item. // The contact item to get. ItemIdType[] itemArray = new ItemIdType[this.ExistContactItems.Count]; this.ExistContactItems.CopyTo(itemArray, 0); GetItemResponseType getItemResponse = this.CallGetItemOperation(itemArray); // Check the response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ContactItemType[] contacts = Common.GetItemsFromInfoResponse <ContactItemType>(getItemResponse); Site.Assert.AreEqual <int>( 1, contacts.Length, string.Format( "The count of items from response should be 1, actual: '{0}'.", contacts.Length)); Site.Assert.AreEqual <string>( FileAsMappingType.LastFirstCompany.ToString(), contacts[0].FileAs, string.Format( "The FileAs property should be updated as set. Expected value: {0}, actual value: {1}", FileAsMappingType.LastFirstCompany.ToString(), contacts[0].FileAs)); #endregion }
public void MSOXWSCORE_S01_TC25_GetItemWithUniqueBodyEnums() { Site.Assume.IsTrue(Common.IsRequirementEnabled(2290, this.Site), "Exchange 2007 does not support the UniqueBody element."); // Define the count of enumerations. int enumCount = 2; BodyTypeResponseType[] bodyTypeResponseTypes = new BodyTypeResponseType[enumCount]; bodyTypeResponseTypes[0] = BodyTypeResponseType.HTML; bodyTypeResponseTypes[1] = BodyTypeResponseType.Text; // Define an item array to store the items got from GetItem operation response. // Each item should contain a BodyTypeResponseType value as its element's value. ItemType[] items = new ItemType[enumCount]; for (int i = 0; i < enumCount; i++) { BodyTypeResponseType bodyTypeType = bodyTypeResponseTypes[i]; #region Step 1: Create the item. ItemType[] createdItems = new ItemType[] { new ItemType() }; createdItems[0].Subject = Common.GenerateResourceName( this.Site, TestSuiteHelper.SubjectForCreateItem); CreateItemResponseType createItemResponse = this.CallCreateItemOperation(DistinguishedFolderIdNameType.drafts, createdItems); // Check the operation response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); ItemIdType[] createdItemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); // One created item should be returned. Site.Assert.AreEqual<int>( 1, createdItemIds.GetLength(0), "One created item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, createdItemIds.GetLength(0)); #endregion #region Step 2: Get the item. GetItemType getItem = new GetItemType(); GetItemResponseType getItemResponse = new GetItemResponseType(); // The Item properties returned getItem.ItemShape = new ItemResponseShapeType(); getItem.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties; getItem.ItemShape.BodyType = bodyTypeType; getItem.ItemShape.BodyTypeSpecified = true; // The item to get getItem.ItemIds = createdItemIds; // Set additional properties. getItem.ItemShape.AdditionalProperties = new PathToUnindexedFieldType[] { new PathToUnindexedFieldType() { FieldURI = UnindexedFieldURIType.itemUniqueBody } }; getItemResponse = this.COREAdapter.GetItem(getItem); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemType[] getItems = Common.GetItemsFromInfoResponse<ItemType>(getItemResponse); // One item should be returned. Site.Assert.AreEqual<int>( 1, getItems.GetLength(0), "One item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItems.GetLength(0)); Site.Assert.IsTrue(this.IsSchemaValidated, "The schema should be validated."); // Assert the NormalizedBody elements is not null. Site.Assert.IsNotNull(getItems[0].UniqueBody, "The UniqueBody element of the item should not be null, actual: {0}.", getItems[0].UniqueBody); items[i] = getItems[0]; #endregion } #region Step 3: Verify the UniqueBody element. // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1681"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1681 this.Site.CaptureRequirementIfAreEqual<BodyTypeType>( BodyTypeType.HTML, items[0].UniqueBody.BodyType1, 1681, @"[In t:ItemType Complex Type] The value ""HTML"" of ""UniqueBody"" specifies the item body as HTML content."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R1682"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R1682 this.Site.CaptureRequirementIfAreEqual<BodyTypeType>( BodyTypeType.Text, items[1].UniqueBody.BodyType1, 1682, @"[In t:ItemType Complex Type] The value ""Text"" of ""UniqueBody"" specifies the item body as text content."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2290"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2290 // The element UniqueBody is returned, so this requirement can be captured. this.Site.CaptureRequirement( 2290, @"[In Appendix C: Product Behavior] Implementation does support the element ""UniqueBody"" which specifies the body part that is unique to the conversation that an item is part of. (Exchange 2010 and above follow this behavior.)"); #endregion }
public void MSOXWSMSG_S06_TC01_OperateMultipleMessages() { #region Create multiple message string subject = Common.GenerateResourceName(this.Site, Common.GetConfigurationPropertyValue("Subject", Site), 0); string anotherSubject = Common.GenerateResourceName(this.Site, Common.GetConfigurationPropertyValue("Subject", Site), 1); CreateItemType createItemRequest = new CreateItemType { MessageDisposition = MessageDispositionType.SaveOnly, // MessageDispositionSpecified value needs to be set. MessageDispositionSpecified = true, SavedItemFolderId = new TargetFolderIdType { Item = new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.drafts } }, Items = new NonEmptyArrayOfAllItemsType { // Create an responseMessageItem with two MessageType instances. Items = new MessageType[] { new MessageType { Sender = new SingleRecipientType { Item = new EmailAddressType { EmailAddress = this.Sender } }, ToRecipients = new EmailAddressType[] { new EmailAddressType { EmailAddress = this.Recipient1 } }, Subject = subject, }, new MessageType { Sender = new SingleRecipientType { Item = new EmailAddressType { EmailAddress = this.Sender } }, ToRecipients = new EmailAddressType[] { new EmailAddressType { EmailAddress = this.Recipient2 } }, Subject = anotherSubject, } } }, }; CreateItemResponseType createItemResponse = this.MSGAdapter.CreateItem(createItemRequest); Site.Assert.IsTrue(this.VerifyMultipleResponse(createItemResponse), @"Server should return success for creating the email messages."); this.infoItems = TestSuiteHelper.GetInfoItemsInResponse(createItemResponse); this.firstItemOfFirstInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 0, 0); Site.Assert.IsNotNull(this.infoItems, @"InfoItems in the returned response should not be null."); Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem, @"The first item of the array of ItemType type returned from server response should not be null."); // Save the first ItemId of message responseMessageItem got from the createItem response. Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem.ItemId, @"The ItemId property of the first item should not be null."); ItemIdType itemIdType1 = new ItemIdType(); itemIdType1.Id = this.firstItemOfFirstInfoItem.ItemId.Id; itemIdType1.ChangeKey = this.firstItemOfFirstInfoItem.ItemId.ChangeKey; // Save the second ItemId. this.firstItemOfSecondInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 1, 0); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem, @"The second item of the array of ItemType type returned from server response should not be null."); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem.ItemId, @"The ItemId property of the second item should not be null."); ItemIdType itemIdType2 = new ItemIdType(); itemIdType2.Id = this.firstItemOfSecondInfoItem.ItemId.Id; itemIdType2.ChangeKey = this.firstItemOfSecondInfoItem.ItemId.ChangeKey; #endregion #region Get the multiple messages which created GetItemType getItemRequest = new GetItemType { // Set the two ItemIds got from CreateItem response. ItemIds = new ItemIdType[] { itemIdType1, itemIdType2 }, ItemShape = new ItemResponseShapeType { BaseShape = DefaultShapeNamesType.AllProperties, } }; GetItemResponseType getItemResponse = this.MSGAdapter.GetItem(getItemRequest); Site.Assert.IsTrue(this.VerifyMultipleResponse(getItemResponse), @"Server should return success for creating the email messages."); #endregion #region Update the multiple messages which created UpdateItemType updateItemRequest = new UpdateItemType { MessageDisposition = MessageDispositionType.SaveOnly, // MessageDispositionSpecified value needs to be set. MessageDispositionSpecified = true, // Create two ItemChangeType instances. ItemChanges = new ItemChangeType[] { new ItemChangeType { Item = itemIdType1, Updates = new ItemChangeDescriptionType[] { new SetItemFieldType { Item = new PathToUnindexedFieldType { FieldURI = UnindexedFieldURIType.messageToRecipients }, // Update ToRecipients property of the first message. Item1 = new MessageType { ToRecipients = new EmailAddressType[] { new EmailAddressType { EmailAddress = this.Recipient2 } } } }, } }, new ItemChangeType { Item = itemIdType2, Updates = new ItemChangeDescriptionType[] { new SetItemFieldType { Item = new PathToUnindexedFieldType { FieldURI = UnindexedFieldURIType.messageToRecipients }, // Update ToRecipients property of the second message. Item1 = new MessageType { ToRecipients = new EmailAddressType[] { new EmailAddressType { EmailAddress = this.Recipient1 } } } }, } } } }; UpdateItemResponseType updateItemResponse = this.MSGAdapter.UpdateItem(updateItemRequest); Site.Assert.IsTrue(this.VerifyMultipleResponse(updateItemResponse), @"Server should return success for updating the email messages."); this.infoItems = TestSuiteHelper.GetInfoItemsInResponse(updateItemResponse); this.firstItemOfFirstInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 0, 0); Site.Assert.IsNotNull(this.infoItems, @"InfoItems in the returned response should not be null."); Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem, @"The first item of the array of ItemType type returned from server response should not be null."); // Save the ItemId of the first message responseMessageItem got from the UpdateItem response. Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem.ItemId, @"The ItemId property of the first item should not be null."); itemIdType1.Id = this.firstItemOfFirstInfoItem.ItemId.Id; itemIdType1.ChangeKey = this.firstItemOfFirstInfoItem.ItemId.ChangeKey; // Save the ItemId of the second message responseMessageItem got from the UpdateItem response. this.firstItemOfSecondInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 1, 0); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem, @"The second item of the array of ItemType type returned from server response should not be null."); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem.ItemId, @"The ItemId property of the second item should not be null."); itemIdType2.Id = this.firstItemOfSecondInfoItem.ItemId.Id; itemIdType2.ChangeKey = this.firstItemOfSecondInfoItem.ItemId.ChangeKey; #endregion #region Copy the updated multiple message to junkemail CopyItemType copyItemRequest = new CopyItemType { ItemIds = new ItemIdType[] { itemIdType1, itemIdType2, }, // Copy the message to junk email folder. ToFolderId = new TargetFolderIdType { Item = new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.junkemail } } }; CopyItemResponseType copyItemResponse = this.MSGAdapter.CopyItem(copyItemRequest); Site.Assert.IsTrue(this.VerifyMultipleResponse(copyItemResponse), @"Server should return success for copying the email messages."); this.infoItems = TestSuiteHelper.GetInfoItemsInResponse(copyItemResponse); this.firstItemOfFirstInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 0, 0); Site.Assert.IsNotNull(this.infoItems, @"InfoItems in the returned response should not be null."); Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem, @"The first item of the array of ItemType type returned from server response should not be null."); // Save the ItemId of the first message responseMessageItem got from the CopyItem response. Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem.ItemId, @"The ItemId property of the first item should not be null."); ItemIdType copyItemIdType1 = new ItemIdType(); copyItemIdType1.Id = this.firstItemOfFirstInfoItem.ItemId.Id; copyItemIdType1.ChangeKey = this.firstItemOfFirstInfoItem.ItemId.ChangeKey; // Save the ItemId of the second message responseMessageItem got from the CopyItem response. this.firstItemOfSecondInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 1, 0); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem, @"The second item of the array of ItemType type returned from server response should not be null."); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem.ItemId, @"The ItemId property of the second item should not be null."); ItemIdType copyItemIdType2 = new ItemIdType(); copyItemIdType2.Id = this.firstItemOfSecondInfoItem.ItemId.Id; copyItemIdType2.ChangeKey = this.firstItemOfSecondInfoItem.ItemId.ChangeKey; #endregion #region Move the copied multiple message from junkemail to deleteditems MoveItemType moveItemRequest = new MoveItemType { // Set to copied message responseMessageItem id. ItemIds = new ItemIdType[] { copyItemIdType1, copyItemIdType2 }, // Move the copied messages to deleted items folder. ToFolderId = new TargetFolderIdType { Item = new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.deleteditems } } }; MoveItemResponseType moveItemResponse = this.MSGAdapter.MoveItem(moveItemRequest); Site.Assert.IsTrue(this.VerifyMultipleResponse(moveItemResponse), @"Server should return success for moving the email messages."); this.infoItems = TestSuiteHelper.GetInfoItemsInResponse(moveItemResponse); this.firstItemOfFirstInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 0, 0); Site.Assert.IsNotNull(this.infoItems, @"InfoItems in the returned response should not be null."); Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem, @"The first item of the array of ItemType type returned from server response should not be null."); // Save the ItemId of the first message responseMessageItem got from the MoveItem response. Site.Assert.IsNotNull(this.firstItemOfFirstInfoItem.ItemId, @"The ItemId property of the first item should not be null."); copyItemIdType1.Id = this.firstItemOfFirstInfoItem.ItemId.Id; copyItemIdType1.ChangeKey = this.firstItemOfFirstInfoItem.ItemId.ChangeKey; // Save the ItemId of the second message responseMessageItem got from the MoveItem response. this.firstItemOfSecondInfoItem = TestSuiteHelper.GetItemTypeItemFromInfoItemsByIndex(this.infoItems, 1, 0); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem, @"The second item of the array of ItemType type returned from server response should not be null."); Site.Assert.IsNotNull(this.firstItemOfSecondInfoItem.ItemId, @"The ItemId property of the second item should not be null."); copyItemIdType2.Id = this.firstItemOfSecondInfoItem.ItemId.Id; copyItemIdType2.ChangeKey = this.firstItemOfSecondInfoItem.ItemId.ChangeKey; #endregion #region Send multiple messages SendItemType sendItemRequest = new SendItemType { // Set to the two updated messages' ItemIds. ItemIds = new ItemIdType[] { itemIdType1, itemIdType2 }, // Do not save copy. SaveItemToFolder = false, }; SendItemResponseType sendItemResponse = this.MSGAdapter.SendItem(sendItemRequest); Site.Assert.IsTrue(this.VerifyMultipleResponse(sendItemResponse), @"Server should return success for sending the email messages."); #endregion #region Delete the copied messages DeleteItemType deleteItemRequest = new DeleteItemType { // Set to the two copied messages' ItemIds. ItemIds = new ItemIdType[] { copyItemIdType1, copyItemIdType2 } }; DeleteItemResponseType deleteItemResponse = this.MSGAdapter.DeleteItem(deleteItemRequest); Site.Assert.IsTrue(this.VerifyMultipleResponse(deleteItemResponse), @"Server should return success for deleting the email messages."); #endregion #region Clean up Recipient1's and Recipient2's inbox folders bool isClear = this.MSGSUTControlAdapter.CleanupFolders( Common.GetConfigurationPropertyValue("Recipient2", this.Site), Common.GetConfigurationPropertyValue("Recipient2Password", this.Site), this.Domain, subject, "inbox"); Site.Assert.IsTrue(isClear, "Recipient2's inbox folder should be cleaned up."); isClear = this.MSGSUTControlAdapter.CleanupFolders( Common.GetConfigurationPropertyValue("Recipient1", this.Site), Common.GetConfigurationPropertyValue("Recipient1Password", this.Site), this.Domain, anotherSubject, "inbox"); Site.Assert.IsTrue(isClear, "Recipient1's inbox folder should be cleaned up."); #endregion }
public void MSOXWSCORE_S07_TC16_GetTaskItemWithTwoItemIdTypesSuccessfully() { #region Step 1: Create a recurring task item. // Define the pattern and range of the recurring task item. DailyRecurrencePatternType pattern = new DailyRecurrencePatternType(); pattern.Interval = 1; NumberedRecurrenceRangeType range = new NumberedRecurrenceRangeType(); int numberOfOccurrences = 5; range.NumberOfOccurrences = numberOfOccurrences; System.DateTime start = System.DateTime.Now; range.StartDate = start; // Define the TaskType item. TaskType[] items = new TaskType[] { new TaskType() }; items[0].Subject = Common.GenerateResourceName( this.Site, TestSuiteHelper.SubjectForCreateItem); items[0].Recurrence = new TaskRecurrenceType(); items[0].Recurrence.Item = pattern; items[0].Recurrence.Item1 = range; // Call CreateItem operation. CreateItemResponseType createItemResponse = this.CallCreateItemOperation(DistinguishedFolderIdNameType.tasks, items); // Check the operation response. Common.CheckOperationSuccess(createItemResponse, 1, this.Site); BaseItemIdType[] createdTaskItemIds = Common.GetItemIdsFromInfoResponse(createItemResponse); // One created task item should be returned. Site.Assert.AreEqual <int>( 1, createdTaskItemIds.GetLength(0), "One created task item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, createdTaskItemIds.GetLength(0)); #endregion #region Step 2: Get the recurring task item by ItemIdType. // Call GetItem operation using the created task item ID. GetItemResponseType getItemResponse = this.CallGetItemOperation(createdTaskItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); #endregion // Exchange 2007 and Exchange 2010 do not support the RecurringMasterItemIdRanges element. SutVersion currentSutVersion = (SutVersion)Enum.Parse(typeof(SutVersion), Common.GetConfigurationPropertyValue("SutVersion", this.Site)); if (currentSutVersion.Equals(SutVersion.ExchangeServer2013)) { #region Step 3: Get the recurring task item by RecurringMasterItemIdRangesType. // Define the RecurringMasterItemIdRanges using the created task item ID. RecurringMasterItemIdRangesType[] recurringMasterItemIdRanges = new RecurringMasterItemIdRangesType[1]; recurringMasterItemIdRanges[0] = new RecurringMasterItemIdRangesType(); recurringMasterItemIdRanges[0].Id = (createdTaskItemIds[0] as ItemIdType).Id; recurringMasterItemIdRanges[0].ChangeKey = (createdTaskItemIds[0] as ItemIdType).ChangeKey; recurringMasterItemIdRanges[0].Ranges = new OccurrencesRangeType[1]; recurringMasterItemIdRanges[0].Ranges[0] = new OccurrencesRangeType(); recurringMasterItemIdRanges[0].Ranges[0].CompareOriginalStartTimeSpecified = true; recurringMasterItemIdRanges[0].Ranges[0].CompareOriginalStartTime = true; recurringMasterItemIdRanges[0].Ranges[0].StartSpecified = true; recurringMasterItemIdRanges[0].Ranges[0].Start = start; recurringMasterItemIdRanges[0].Ranges[0].EndSpecified = true; recurringMasterItemIdRanges[0].Ranges[0].End = start.AddDays(numberOfOccurrences); // Call GetItem operation using the recurringMasterItemIdRanges. getItemResponse = this.CallGetItemOperation(recurringMasterItemIdRanges); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); #endregion } }
private ItemType[] GetRemoteCalendarItems(List <SearchExpressionType> searchItems) { FindItemType findItemType = new FindItemType(); findItemType.ItemShape = CalendarItemFields.CalendarQueryShape; findItemType.ParentFolderIds = new BaseFolderIdType[] { new DistinguishedFolderIdType { Id = DistinguishedFolderIdNameType.calendar } }; findItemType.Restriction = new RestrictionType { Item = new OrType { Items = searchItems.ToArray() } }; FindItemResponseType response = this.binding.FindItem(findItemType); ItemType[] array = this.HandleFindItemResponse(response); if (array == null) { Globals.ConsistencyChecksTracer.TraceDebug((long)this.GetHashCode(), "FindItem returned NULL ArrayOfRealItemsType."); return(null); } List <ItemIdType> list = new List <ItemIdType>(); foreach (ItemType itemType in array) { if (itemType is CalendarItemType) { CalendarItemType calendarItemType = itemType as CalendarItemType; if (calendarItemType.CalendarItemType1 == CalendarItemTypeType.Single) { list.Add(itemType.ItemId); } else { OccurrencesRangeType occurrencesRangeType = new OccurrencesRangeType { Start = base.ValidateFrom.UniversalTime, StartSpecified = true, End = base.ValidateUntil.UniversalTime, EndSpecified = true, Count = 100, CountSpecified = true }; RecurringMasterItemIdRangesType item = new RecurringMasterItemIdRangesType { Id = itemType.ItemId.Id, ChangeKey = itemType.ItemId.ChangeKey, Ranges = new OccurrencesRangeType[] { occurrencesRangeType } }; list.Add(item); } } else { Globals.ConsistencyChecksTracer.TraceDebug((long)this.GetHashCode(), "FindItem returned an item which is not a CalendarItemType. Skipping it."); } } if (list.Count < 1) { Globals.ConsistencyChecksTracer.TraceDebug((long)this.GetHashCode(), "FindItem didn't return valid items."); return(null); } GetItemType getItem = new GetItemType { ItemShape = CalendarItemFields.CalendarItemShape, ItemIds = list.ToArray() }; GetItemResponseType item2 = this.binding.GetItem(getItem); ItemType[] array3 = this.HandleGetItemResponse(item2); if (array3 == null) { Globals.ConsistencyChecksTracer.TraceDebug((long)this.GetHashCode(), "GetItem returned NULL ItemType[]."); } return(array3); }
public void MSOXWSCORE_S07_TC02_CopyTaskItemSuccessfully() { #region Step 1: Create the task item. TaskType item = new TaskType(); ItemIdType[] createdItemIds = this.CreateItemWithMinimumElements(item); #endregion #region Step 2: Copy the task item. // Call CopyItem operation. CopyItemResponseType copyItemResponse = this.CallCopyItemOperation(DistinguishedFolderIdNameType.drafts, createdItemIds); // Check the operation response. Common.CheckOperationSuccess(copyItemResponse, 1, this.Site); ItemIdType[] copiedItemIds = Common.GetItemIdsFromInfoResponse(copyItemResponse); // One copied task item should be returned. Site.Assert.AreEqual <int>( 1, copiedItemIds.GetLength(0), "One copied task item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, copiedItemIds.GetLength(0)); #endregion #region Step 3: Get the first created task item success. // Call the GetItem operation. GetItemResponseType getItemResponse = this.CallGetItemOperation(createdItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); ItemIdType[] getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One task item should be returned. Site.Assert.AreEqual <int>( 1, getItemIds.GetLength(0), "One task item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSCORE_R2021"); // Verify MS-OXWSCORE requirement: MS-OXWSCORE_R2021 this.Site.CaptureRequirementIfAreEqual <string>( "IPM.Task", ((ItemInfoResponseMessageType)getItemResponse.ResponseMessages.Items[0]).Items.Items[0].ItemClass, 2021, @"[In t:ItemType Complex Type] This value is ""IPM.Task"" for task item."); #endregion #region Step 4: Get the second copied task item success. // Call the GetItem operation. getItemResponse = this.CallGetItemOperation(copiedItemIds); // Check the operation response. Common.CheckOperationSuccess(getItemResponse, 1, this.Site); getItemIds = Common.GetItemIdsFromInfoResponse(getItemResponse); // One task item should be returned. Site.Assert.AreEqual <int>( 1, getItemIds.GetLength(0), "One task item should be returned! Expected Item Count: {0}, Actual Item Count: {1}", 1, getItemIds.GetLength(0)); #endregion }
/// <summary> /// Verify the WSDL port type specifications for the GetItem operation and GetItemResponseType structure /// </summary> /// <param name="response">The response message of GetItem operation.</param> /// <param name="isSchemaValidated">The result of schema validation, true means valid.</param> private void VerifyGetItemOperation(GetItemResponseType response, bool isSchemaValidated) { Site.Assert.IsTrue(isSchemaValidated, "The schema validation should be true."); // Verify the WSDL port type specifications for the GetItem operation. // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R436"); // Verify MS-OXWSMTGS requirement: MS-OXWSMTGS_R436 Site.CaptureRequirementIfIsTrue( isSchemaValidated, 436, @"[In GetItem operation] The following is the WSDL port type specification for the GetItem operation. <wsdl:operation name=""GetItem""> <wsdl:input message=""tns:GetItemSoapIn"" /> <wsdl:output message=""tns:GetItemSoapOut"" /> </wsdl:operation>"); // Verify the WSDL binding specification for the GetItem operation if (Common.IsRequirementEnabled(694, Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R694"); // Verify MS-OXWSMTGS requirement: MS-OXWSMTGS_R694 this.Site.CaptureRequirementIfIsTrue( isSchemaValidated, 694, @"[In Appendix C: Product Behavior] Implementation does include the following WSDL binding specification for the GetItem operation. <wsdl:operation name=""GetItem""> <soap:operation soapAction=""http://schemas.microsoft.com/exchange/services/2006/messages/GetItem""/> <wsdl:input> <soap:header message=""tns:GetItemSoapIn"" part=""Impersonation"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""MailboxCulture"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""RequestVersion"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""TimeZoneContext"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""DateTimePrecision"" use=""literal"" /> <soap:body parts=""request"" use=""literal""/> </wsdl:input> <wsdl:output> <soap:body parts=""GetItemResult"" use=""literal""/> <soap:header message=""tns:GetItemSoapOut"" part=""ServerVersion"" use=""literal""/> </wsdl:output> </wsdl:operation> (Exchange 2013 and above follow this behavior.)"); } if (Common.IsRequirementEnabled(695, Site)) { // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXWSMTGS_R695"); // Verify MS-OXWSMTGS requirement: MS-OXWSMTGS_R695 this.Site.CaptureRequirementIfIsTrue( isSchemaValidated, 695, @"[In Appendix C: Product Behavior] Implementation does include the following WSDL binding specification for the GetItem operation. <wsdl:operation name=""GetItem""> <soap:operation soapAction=""http://schemas.microsoft.com/exchange/services/2006/messages/GetItem""/> <wsdl:input> <soap:header message=""tns:GetItemSoapIn"" part=""Impersonation"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""MailboxCulture"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""RequestVersion"" use=""literal""/> <soap:header message=""tns:GetItemSoapIn"" part=""TimeZoneContext"" use=""literal""/> <soap:body parts=""request"" use=""literal""/> </wsdl:input> <wsdl:output> <soap:body parts=""GetItemResult"" use=""literal""/> <soap:header message=""tns:GetItemSoapOut"" part=""ServerVersion"" use=""literal""/> </wsdl:output> </wsdl:operation> (Exchange 2007, Exchange 2010 and Exchange 2010 SP1 follow this behavior.)"); } // Verify items foreach (ResponseMessageType responseMessage in response.ResponseMessages.Items) { if (responseMessage.ResponseClass == ResponseClassType.Success) { ItemInfoResponseMessageType itemInfo = responseMessage as ItemInfoResponseMessageType; // Each ItemInfoResponseMessageType contains one calendar related item for GetItem operation. ItemType item = itemInfo.Items.Items[0]; this.VerifyItemTypeItems(item, isSchemaValidated); } } }