Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Web Service(WCF) to integrate with QuickBooks

Tags:

wcf

quickbooks

I am in the process of integrating our custom web app with QuickBooks Enterprise 9. My thought is that I could use QuickBooks as my "database" of sorts. When a person creates an invoice, the invoice is actually stored only in QuickBooks. When a person views a list of invoices, they are actually viewing a list of QuickBooks invoices. I want to make sure the data is stored in only one location.

I realize that I could use the QB Web Connector, but the problem with that is I wouldn't have control over when the requests to QB actually get processed (That job is up to the Web Connector).

So I have my web UI to act as the QuickBooks "face," but I don't have any good way to get to and from the QuickBooks file located on an internal server. What I was thinking was that I could create a WCF web service and install it on the QuickBooks server. The web service could then be my integration point. My custom web app could then consume the web service and, viola, I have access to my QuickBooks files.

My question is this: Can a WCF app connect and run QuickBooks? If not, could i create a Windows service to act as my point of integration? If so, can my custom web app "consume" a windows service?

like image 400
CodingBytes Avatar asked Aug 12 '09 16:08

CodingBytes


1 Answers

I'll start by warning you that QuickBooks probably isn't your best choice for a reliable back-end database accessible from a remote website. In fact... it's probably a really, really bad choice.

You should have your own application database, and then if you need to also exchange data with QuickBooks, do that outside of the normal lifecycle of your app, as a separate sync process.

QuickBooks generally isn't reliable enough for always-online type of applications due to a number of reasons:

  • Flaky SDK connections
  • Updates and single-user mode will lock you out of accessing QuickBooks
  • Difficulty in establishing SDK connections from non-GUI processes (Windows Services and IIS processes)

With that said...

Yes, you could create a WCF web service, host it on the QuickBooks machine, and make your WCF web service relay messages to/from QuickBooks.

Yes, you could also create a Windows Service that does the same sort of thing.

Do NOT implement it as a Windows service, and do NOT implement it within IIS - instead implement it as a GUI app that runs alongside QuickBooks.

If you try to implement things as a Windows service or within IIS, the QuickBooks SDK requires you have a GUI available (it users a GUI COM message pump for events dispatching or something like that...) to process requests, so you'll probably need to use something like QBXMLRP2e.exe to straddle the process boundary between QuickBooks and your non-GUI Windows service/IIS. My experience has been that it's a gigantic pain in the butt, and requires mucking with DCOM permissions as well.

I have an example and some documentation on my QuickBooks integration wiki.

The IDN Forums are a good place to ask questions.

My recommendation to you would be to either:

  • Use the Web Connector and QuickBooks and give up hope of keeping all of your data in one place. Cache the data in a real database, and update it by querying QuickBooks periodically. I'm almost done building a solution to do exactly this right now, and it works fantastic.

OR

  • Use a different account system. NetSuite is pretty nice. I'm not sure what else is out there, but if I were you I'd look for something SQL-based or with a strong SOAP/REST API.
like image 164
Keith Palmer Jr. Avatar answered Nov 11 '22 05:11

Keith Palmer Jr.