我正在嘗試編寫一個程序,該程序只需連接到GP WebService並調用GetCustomerList()方法即可從Great Plains獲取客戶。我在下面概述的代碼是我能夠在文檔中找到的重複項,但是,當我運行它時,我收到了一個SoapException。我不知道我是否缺少憑證(例如用戶名和密碼),或者我是否正確調用了這些憑證。我相信我在Dynamics Security Console中正確設置了安全設置,但我不是100%確定的,或者是否有其他需要配置的內容。任何幫助將不勝感激。嘗試訪問GP WebServices時出現SOAP異常
public IList<string> GetCustomerNames()
{
//Added a ServiceReference to the actual WebService which appears to be working
var service = new DynamicsGPClient();
var context = new Context();
var customerKey = new CustomerKey();
var companyKey = new CompanyKey();
//Trying to load the test data
companyKey.Id = (-1);
context.OrganizationKey = (OrganizationKey)companyKey;
//Trying to load the test data
customerKey.Id = "AARONFIT0001";
var customers = service.GetCustomerList(new CustomerCriteria(), context);
return customers.Select(x => x.Name).ToList();
}
我使用Dynamics GP的2010 – bkorzynski