I used the Quickbooks SDK because I was developing an import tool for a friend and we did not have the luxury of buying a third-party library.
I started developing it as a web service, but I had to step back after I realized that we need to not only deploy the redistributable Quickbooks SDK on the server, but we also need to install Quickbooks on our own. And more often than never, Quickbooks displayed a dialog that is bad on the server.
While this dialog has been opened, the Quickbooks SDK will refuse any connection to it.
In the end, I did it as a pure C # Winform program. From there, its quite a breakthrough.
The program was based on a fast boot session class that handled the session and message
public static class Quickbooks { public static QuickbookSession CreateSession() { return new QuickbookSession(); } } public class QuickbookSession : IDisposable {
After that, it was easy to create a session, create a message, and add another request.
using(var session = Quickbooks.CreateSession()) { // Check if the job already exist using (var message = session.CreateMessage()) { var jobQuery = message.AppendCustomerQueryRq(); jobQuery.ORCustomerListQuery.CustomerListFilter.ORNameFilter.NameFilter.Name.SetValue("something"); jobQuery.ORCustomerListQuery.CustomerListFilter.ORNameFilter.NameFilter.MatchCriterion.SetValue(ENMatchCriterion.mcContains); var result = message.Send(); // do stuff here with the result } }
This code is far from being bulletproof from many of the traps of Quickbooks. Quickbooks SDKs are also pretty slow. For example, getting a list of suppliers takes about 2 minutes for about 1,000 suppliers.
Pierre-alain vigeant
source share