/// <summary>
        /// The GetListItemChangesWithKnowledge operation is used to get changes made to a specified list after the event expressed by the knowledge parameter, 
        /// if specified, or to return all the list items in the list.
        /// </summary>
        /// <param name="listName">Get list name</param>
        /// <param name="viewName">The GUID of a view of the list</param>
        /// <param name="query">Query the list</param>
        /// <param name="viewFields">Specifies which fields of the list item should be returned</param>
        /// <param name="rowLimit">The maximum number of rows of data to return</param>
        /// <param name="queryOptions">Specifies various options for modifying the query</param>
        /// <param name="syncScope">This parameter MUST be null or empty</param>
        /// <param name="knowledge">Specifies the knowledge data structure in XML format</param>
        /// <param name="contains">Specifies a value to search for</param>
        /// <returns>The value indicating the error code in the thrown SOAP fault.</returns>
        public GetListItemChangesWithKnowledgeResponseGetListItemChangesWithKnowledgeResult GetListItemChangesWithKnowledge(
            string listName, 
            string viewName,
            GetListItemChangesWithKnowledgeQuery query, 
            CamlViewFields viewFields,
            string rowLimit,
            CamlQueryOptions queryOptions, 
            string syncScope,
            GetListItemChangesWithKnowledgeKnowledge knowledge, 
            CamlContains contains)
        {
            this.Site.Assert.IsNotNull(this.listsProxy, "The Proxy instance should not be NULL. If assert failed, the adapter need to be initialized");

            GetListItemChangesWithKnowledgeResponseGetListItemChangesWithKnowledgeResult result = null;
            try
            {
                result = this.listsProxy.GetListItemChangesWithKnowledge(listName, viewName, query, viewFields, rowLimit, queryOptions, syncScope, knowledge, contains);

                // Verify the requirements of the GetListItemChangesWithKnowledge operation.
                this.VerifyGetListItemChangesWithKnowledgeOperation(result, queryOptions, viewFields);
            }
            catch (XmlSchemaValidationException exp)
            {
                // Log the errors and warnings
                this.LogSchemaValidationErrors();

                this.Site.Assert.Fail(exp.Message);
            }
            catch (SoapException)
            {
                this.VerifySoapExceptionFault();
                throw;
            }

            return result;
        }
 /// <remarks/>
 public void GetListItemChangesWithKnowledgeAsync(string listName, string viewName, GetListItemChangesWithKnowledgeQuery query, CamlViewFields viewFields, string rowLimit, CamlQueryOptions queryOptions, string syncScope, GetListItemChangesWithKnowledgeKnowledge knowledge, CamlContains contains, object userState)
 {
     if ((this.GetListItemChangesWithKnowledgeOperationCompleted == null))
     {
         this.GetListItemChangesWithKnowledgeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetListItemChangesWithKnowledgeOperationCompleted);
     }
     this.InvokeAsync("GetListItemChangesWithKnowledge", new object[] {
             listName,
             viewName,
             query,
             viewFields,
             rowLimit,
             queryOptions,
             syncScope,
             knowledge,
             contains}, this.GetListItemChangesWithKnowledgeOperationCompleted, userState);
 }
 /// <remarks/>
 public void GetListItemChangesWithKnowledgeAsync(string listName, string viewName, GetListItemChangesWithKnowledgeQuery query, CamlViewFields viewFields, string rowLimit, CamlQueryOptions queryOptions, string syncScope, GetListItemChangesWithKnowledgeKnowledge knowledge, CamlContains contains)
 {
     this.GetListItemChangesWithKnowledgeAsync(listName, viewName, query, viewFields, rowLimit, queryOptions, syncScope, knowledge, contains, null);
 }
 /// <remarks/>
 public System.IAsyncResult BeginGetListItemChangesWithKnowledge(string listName, string viewName, GetListItemChangesWithKnowledgeQuery query, CamlViewFields viewFields, string rowLimit, CamlQueryOptions queryOptions, string syncScope, GetListItemChangesWithKnowledgeKnowledge knowledge, CamlContains contains, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("GetListItemChangesWithKnowledge", new object[] {
             listName,
             viewName,
             query,
             viewFields,
             rowLimit,
             queryOptions,
             syncScope,
             knowledge,
             contains}, callback, asyncState);
 }
 public GetListItemChangesWithKnowledgeResponseGetListItemChangesWithKnowledgeResult GetListItemChangesWithKnowledge(string listName, string viewName, GetListItemChangesWithKnowledgeQuery query, CamlViewFields viewFields, string rowLimit, CamlQueryOptions queryOptions, string syncScope, GetListItemChangesWithKnowledgeKnowledge knowledge, CamlContains contains)
 {
     object[] results = this.Invoke("GetListItemChangesWithKnowledge", new object[] {
             listName,
             viewName,
             query,
             viewFields,
             rowLimit,
             queryOptions,
             syncScope,
             knowledge,
             contains});
     return ((GetListItemChangesWithKnowledgeResponseGetListItemChangesWithKnowledgeResult)(results[0]));
 }
        public void MSLISTSWS_S03_TC25_GetListItemChangesWithKnowledge_SpecifiedKnowledge()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(24881, this.Site), @"Test is executed only when R24881Enabled is set to true.");

            // Create a list
            string listId = TestSuiteHelper.CreateList();

            // Insert 1 items
            TestSuiteHelper.AddListItems(listId, 1);

            // Get the syncKnowledge.
            GetListItemChangesWithKnowledgeResponseGetListItemChangesWithKnowledgeResult result = null;
            result = this.listswsAdapter.GetListItemChangesWithKnowledge(
                                            listId,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null);
            syncKnowledge knowledge = result.listitems.Changes.MadeWithKnowledge.syncKnowledge;
            bool isMoreChangeIncludedWithoutKnowledge = string.Compare("True", result.listitems.Changes.MoreChanges, StringComparison.OrdinalIgnoreCase) == 0;

            // Insert 20 items again
            int totalNumber = 20;
            TestSuiteHelper.AddListItems(listId, totalNumber);

            // Call GetListItemChangesWithKnowledge to get all the 20 items which are make after the knowledge is retrieved.
            GetListItemChangesWithKnowledgeKnowledge syncKnowledge = new GetListItemChangesWithKnowledgeKnowledge();
            syncKnowledge.syncKnowledge = knowledge;
            result = this.listswsAdapter.GetListItemChangesWithKnowledge(
                                            listId,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null,
                                            syncKnowledge,
                                            null);

            // If the RowLimit is not specified, the server will response all changes made to list items after the knowledge data structure.
            DataTable data = AdapterHelper.ExtractData(result.listitems.data.Any);
            this.Site.Assert.AreEqual<int>(
                            totalNumber,
                            data.Rows.Count,
                            "The response will include changes made to list items after the knowledge data structure was retrieved if there are no RowLimit specified.");

            // Insert another 20 items again.
            TestSuiteHelper.AddListItems(listId, totalNumber);

            // Call GetListItemChangesWithKnowledge with previous knowledge and specified RowLimit.
            syncKnowledge.syncKnowledge = result.listitems.Changes.MadeWithKnowledge.syncKnowledge;
            int expectRowLimit = 5;
            result = this.listswsAdapter.GetListItemChangesWithKnowledge(
                                            listId,
                                            null,
                                            null,
                                            null,
                                            expectRowLimit.ToString(),
                                            null,
                                            null,
                                            syncKnowledge,
                                            null);
            data = AdapterHelper.ExtractData(result.listitems.data.Any);

            // If the RowLimit is specified, the return items will restricted by this element.
            this.Site.Assert.AreEqual<int>(
                            expectRowLimit,
                            data.Rows.Count,
                            "The 5 items will be returned if the RowLimit value is 5 when calling GetListItemChangesWithKnowledge.");

            // If whether the RowLimit is specified or not, the server only return the changes made after knowledge
            // then R1114 can be captured.
            this.Site.CaptureRequirementIfAreEqual<int>(
                        expectRowLimit,
                        data.Rows.Count,
                        1114,
                        @"[In GetListItemChangesWithKnowledge]If specified, the response will include changes made to list items after the knowledge data structure was retrieved, subject to the row limit restrictions just described.");

            bool isMoreChange = string.Compare("True", result.listitems.Changes.MoreChanges, StringComparison.OrdinalIgnoreCase) == 0;
            this.Site.Assert.IsTrue(
                            isMoreChange,
                            "If there are more changes, the server will response attribute MoreChanges 'True', but actual value is {0}",
                            result.listitems.Changes.MoreChanges);

            // If the attribute MoreChange is "True", then R1120 and R1131 can be captured.
            this.Site.CaptureRequirementIfIsTrue(
                        isMoreChange,
                        1120,
                        @"[In GetListItemChangesWithKnowledge]The Changes element in the response MUST include the attribute MoreChanges set to ""TRUE"" to indicate that protocol clients can make another call to GetListItemChangesWithKnowledge by using the new knowledge from the most recent response to retrieve subsequent changes.");
            this.Site.CaptureRequirementIfIsTrue(
                        isMoreChange,
                        1131,
                        @"[In GetListItemChangesWithKnowledgeResponse][Attribute of MoreChanges]The Changes element in the response MUST include the attribute MoreChanges set to ""TRUE"" if more changes are known to the protocol server than were returned to the protocol client.");
            this.Site.CaptureRequirementIfIsTrue(
                        !isMoreChangeIncludedWithoutKnowledge && isMoreChange,
                        1133,
                        @"[In GetListItemChangesWithKnowledgeResponse][Attribute of Morechanges]MoreChanges MUST be included in the result only if the knowledge parameter was specified by the protocol client in the request.");

            // Add one field to make schema changed. 
            TestSuiteHelper.AddFieldsToList(
                                listId,
                                new List<string> { TestSuiteHelper.GetUniqueFieldName() },
                                new List<string> { "Text" },
                                new List<string> { null });

            // Retrieve the knowledge again.
            syncKnowledge.syncKnowledge = result.listitems.Changes.MadeWithKnowledge.syncKnowledge;
            result = this.listswsAdapter.GetListItemChangesWithKnowledge(
                                            listId,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null,
                                            null,
                                            syncKnowledge,
                                            null);

            bool isSchemaChange = string.Compare("True", result.listitems.Changes.SchemaChanged, StringComparison.OrdinalIgnoreCase) == 0;
            this.Site.Assert.IsTrue(
                            isSchemaChange,
                            "If there are schema changed, the server will response attribute SchemaChanged 'True', but actual value is {0}",
                            result.listitems.Changes.SchemaChanged);

            this.Site.CaptureRequirementIfIsTrue(
                            isSchemaChange,
                            1134,
                            @"[In GetListItemChangesWithKnowledgeResponse][Attribute of SchemaChanged]The SchemaChanged attribute MUST be set to ""TRUE"" if there have schema changes made to the list.");
        }