我有以下代码
QBSessionManager sessionManager = new QBSessionManager();
RequestProcessor2Class requestProcessor = new RequestProcessor2Class();
try
{
IMsgSetRequest msgSetRequest = sessionManager.CreateMsgSetRequest("US", 13, 0);
msgSetRequest.Attributes.OnError = ENRqOnError.roeStop;
// Query all the customers
ICustomerQuery customerQuery = msgSetRequest.AppendCustomerQueryRq();
customerQuery.ORCustomerListQuery.CustomerListFilter.ORNameFilter.NameFilter.MatchCriterion.SetValue(ENMatchCriterion.mcContains);
customerQuery.ORCustomerListQuery.CustomerListFilter.ORNameFilter.NameFilter.Name.SetValue(customerName);
inputRequestXML = msgSetRequest.ToXMLString();
requestProcessor.OpenConnection("QBWebSite", "QuickBooks");
ticket = requestProcessor.BeginSession("$Path\\sample_consulting business.qbw",QBFileMode.qbFileOpenDoNotCare);
response = requestProcessor.ProcessRequest(ticket, inputRequestXML);
responseTextbox.Text = response;
在回发页面时,它会抛出“尚未调用“BeginSession”方法或未成功”,并且COMException为“[COMException(0x8004040c):尚未调用“BeginSession”方法或未成功。 ]"
我究竟做错了什么。请帮忙
我正在使用带有 .NET 4.0 框架的 quickbooks 14 企业版。我确保在 IIS 中将 32 位标志设置为 true。