I have the following code
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;
While postback of the page it throws the "The "BeginSession" method has not been called or it did not succeed" and the COMException is "[COMException (0x8004040c): The "BeginSession" method has not been called or it did not succeed.]"
What am I doing wrong. Please help
I am using the quickbooks 14 enterprise version with .NET 4.0 framework. I made sure that the 32 bit flag is set to true in IIS.