I want to get a list of customers via a web service in AX. I was hoping to use the CustCustomerService class, but I'm not having much luck. My code is:
CustCustomerSvc.CallContext cc = new CustCustomerSvc.CallContext();
cc.Company = "DAT";
CustCustomerSvc.CustomerServiceClient csc = new CustCustomerSvc.CustomerServiceClient();
CustCustomerSvc.EntityKey[] ek = new CustCustomerSvc.EntityKey[1];
CustCustomerSvc.DocumentPaging dp = new CustCustomerSvc.DocumentPaging();
dp.PageSize = 100;
CustCustomerSvc.EntityKeyPage ekp = csc.getKeys(cc, dp);
foreach (CustCustomerSvc.EntityKey key in ekp.EntityKeyList)
{
object ob = key.KeyData.GetValue(0);
Debug.WriteLine(ob.ToString());
}
I published the service, but it doesn't seem to retrieve anything (doesn't return errors either). I get no entity keys even though all my companies have customers.
Am I doing something wrong? Do I need to create my own service?
What we'd like to do is have an external service that iterates through the customers and updates the Lat/Lon on their addresses.
*This post is locked for comments
I have the same question (0)