I have a homemade C++ app built using the Quickbooks SDK version 13. The purpose of the app is to allow me to talk to Quickbooks by receiving an XML string from a network port. I'm able to communicate using qbXML version 2.1. It's talking to Quickbooks Enterprise version 16. I'm surprised, then, that when I run a host query...
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="2.1"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<HostQueryRq></HostQueryRq>
</QBXMLMsgsRq>
</QBXML>
...that the output is this:
<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<HostQueryRs statusCode="0" statusSeverity="Info" statusMessage="Status OK">
<HostRet>
<ProductName>Intuit QuickBooks Enterprise Solutions: Manufacturing and Wholesale 16.0</ProductName>
<MajorVersion>26</MajorVersion>
<MinorVersion>0</MinorVersion>
<SupportedQBXMLVersion>1.0</SupportedQBXMLVersion>
<SupportedQBXMLVersion>1.1</SupportedQBXMLVersion>
<SupportedQBXMLVersion>2.0</SupportedQBXMLVersion>
<SupportedQBXMLVersion>2.1</SupportedQBXMLVersion>
</HostRet>
</HostQueryRs>
</QBXMLMsgsRs>
</QBXML>
Version 13 of the SDK is obviously supposed to be able to use version 13 of qbXML, and Quickbooks Enterprise 16 is supposed to be compatible with qbXML higher than 2.1. There is a feature of qbXML that I need to use that is only available after qbXML 2.1. These release notes from Intuit state that Quickbooks Enterprise 14.0 is compatible with qbXML versions 13.0, 12.0, 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.1, 4.0, 3.0, 2.1, 2.0, 1.1, and 1.0. Of course, later versions like 16 would also be compatible with those.
Why is Quickbooks telling me it can only use qbXML 2.1? What can I do to use a newer version?
Edit: Sorry I forgot to mention before that changing <?qbxml version="2.1"?>
to <?qbxml version="13.0"?>
or any value above 2.1 returns an error of 80040428
which means "The current request processor does not support the request." Also, if I use <?qbxml version="2.0"?>
, I still get <SupportedQBXMLVersion>2.1</SupportedQBXMLVersion>
.
Why is Quickbooks telling me it can only use qbXML 2.1?
I had the same issue. I was using code that I had lifted from the SDK located in C:\Program Files (x86)\Intuit\IDN\QBSDK13.0\samples\qbdt\cpp\qbxml\sdktest
and was getting the same results of supported qbXML
versions 1.0
through 2.1
.
The sdktest
code imports the QBXMLRP.dll
(see below) which only supports versions 1.0
through 2.1
:
/*---------------------------------------------------------------------------
* FILE: SDKTest.cpp
*
* Description:
* QBXMLRP API tester. Run "sdktest -h" to learn how to use it.
*
* Created On: 09/09/2001
*
* Copyright (c) 2001-2013 Intuit Inc. All rights reserved.
* Use is subject to the terms specified at:
* http://developer.intuit.com/legal/devsite_tos.html
*
*/
#include <ctype.h>
#include <ctime>
#include <fstream>
#include <atlbase.h>
#include <iostream>
#include <string>
using namespace std;
#import "QBXMLRP.dll" // this supports only up to v 2.1
The QuickBooks SDK Programmer's Guide states:
Starting with SDK 3.0, a new Request Processor is available, QBXMLRP2Lib.RequestProcessor2. Only this new Request Processor supports event subscription and other new features of SDK 3.0. Backwards compatibility with the old Request Processor is maintained in the new one.
In order to use the newer QBXMLRP2Lib
:
QBXmlConsole
Interopt.QBXMLRP2
QBXmlConsole.cpp
fileNow when I run, for instance, QBXmlConsole.exe < "\Program Files (x86)\Intuit\IDN\QBSDK13.0\samples\xmlfiles\HostQueryRq.xml"
, I get supported versions 1.0
through 13.0
. If you run into issues check out the SDK's hostquery
example. Hope it helps.
/** QBXmlConsole.cpp **/
#include "pch.h"
using namespace System;
using namespace Interop::QBXMLRP2; // supports all version of qbXML
int main(array<System::String ^> ^args)
{
String^ ticket;
String^ request;
String^ response;
String^ line;
int err = 0;
while ((line = Console::ReadLine()) != nullptr) {
if (line->StartsWith("<!--")) {
continue;
}
request = request + line + "\n";
}
Console::WriteLine("Processing XML:");
Console::WriteLine(request);
Console::WriteLine("--");
Interop::QBXMLRP2::IRequestProcessor6^ rqPtr = gcnew Interop::QBXMLRP2::RequestProcessor3;
try {
rqPtr->OpenConnection2("123", "QBXmlConsole", Interop::QBXMLRP2::QBXMLRPConnectionType::localQBD);
ticket = rqPtr->BeginSession("", Interop::QBXMLRP2::QBFileMode::qbFileOpenDoNotCare);
response = rqPtr->ProcessRequest(ticket, request);
rqPtr->EndSession(ticket);
rqPtr->CloseConnection();
}
catch (Runtime::InteropServices::COMException^) {
response = "Handled exception: " + rqPtr->GetQBLastError();
err = 1;
}
Console::Write(response);
Console::WriteLine("Query complete");
return err;
}
Edit: I suppose it is entirely possible that instead of importing the QBXMLRP.dll
that you could try to just import the Interopt.QBXMLRP2Lib.dll
, but that is something I did not try.