Xrm.Tools.CRMWebAPI icon indicating copy to clipboard operation
Xrm.Tools.CRMWebAPI copied to clipboard

Malformed XML in the paging cookie

Open priyanksster opened this issue 3 years ago • 0 comments

@davidyack as the current version of CRMWebAPI doesn't support large set of data, I was trying out the code from https://github.com/mohsinonxrm/Xrm.Tools.CRMWebAPI which supports more than 5K of records. Unfortunately, I am getting the error of Malformed XML in the paging cookie at the following line of GetList :

var pageCookie = fetchXMLPagingCookie.ToString().Replace("+", " "); pageCookie = Uri.UnescapeDataString(Uri.UnescapeDataString(pageCookie)); pageCookie = pageCookie.Substring(pageCookie.IndexOf("pagingcookie"), (pageCookie.IndexOf("/>"))); pageCookie = pageCookie.Substring(pageCookie.IndexOf("=") + 2, (pageCookie.IndexOf(@"/>") - 3));

                var fetchXML = CreateXml(QueryOptions.FetchXml, pageCookie, QueryOptions.PageNumber, QueryOptions.PageSize);
                QueryOptions.FetchXml = fetchXML;

                //Use recurrsion to get the subsequent pages
                var result = await GetList(uri, QueryOptions);

Any idea, what could be wrong? Has anyone else experienced the same?

priyanksster avatar Aug 12 '22 09:08 priyanksster