Question about "You must specify a valid Context Record ID" error

I'm trying to use ListService to get Data List: Code Table Entry List. I always got "You must specify a valid Context Record ID" error. How to find correct Record ID? Is the following code correct?

BasicHttpBinding httpBind = new BasicHttpBinding();
httpBind.Security.Mode = BasicHttpSecurityMode.Transport;
httpBind.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;

EndpointAddress epCodeList = new EndpointAddress("https://crmxxxxxx.sky.blackbaud.com/xxxxxx/vpp/bizops/db[xxxxxx]/dataLists/e3ef2f4e-3ad0-4332-b146-87923c1d430d/soap.asmx");
var svcCodeList = new CodeTableListService.ListServiceSoapClient(httpBind, epCodeList);

svcCodeList.ClientCredentials.UserName.UserName = userName;
svcCodeList.ClientCredentials.UserName.Password = password;

var reqCodeTables = new CodeTableListService.GetRowsRequest() { };

reqCodeTables.SecurityContext = new BizOpsRequestSecurityContext() {
SecurityFeatureType = SecurityFeatureType.DataList,
RecordContextRecordID = "42AAC982-65CA-4C1B-9E11-779CB83175A6"
};

var list = svcCodeList.GetRowsAsync(reqCodeTables).Result;

Thanks,

Categories