Wednesday, June 7, 2017

QuickBooks Web Connector with Java

The QuickBooks Web Connector is a great alternative to integration with QuickBooks , because with QBWC is not necessary to use the COM + components that limit the choice of technology to be used in the integration.
The source code of the guide is available on GitHub:

Advantages of QuickBooks Web Connector

  • Communication with your server is performed through Web services, so it is not necessary to tether your application with COM + components (windows).
  • Web services can be developed in any language and on any platform, as long as it supports Web services.
  • QBWC can be configured to invoke your server from time to time, so it is not necessary for the user to do a manual intervention, having to open an application, click on synchronize etc. Simply configure QBWC to invoke Web services in the desired time interval.
  • It is easier to create generic applications (SaaS), because each QBWC request, in addition to user and password, it sends application identification, so a Web services can serve several clients.

Environment

To develop integration with Java, I'm using:
  • Eclipse
  • QuickBooks Enterprise Edition 10.0
  • QuickBooks Web Connector 2.0.0.139

First step - Creating the QWC file

The QWC file is the configuration file for your Web services in QBWC.
<?xml version="1.0"?>
<QBWCXML>
  <AppName>WCWebService1</AppName>
  <AppID></AppID>
  <AppURL>http://localhost/WCWebService/WCWebService.asmx</AppURL>
  <AppDescription>A short description for WCWebService1</AppDescription>
  <AppSupport>http://developer.intuit.com</AppSupport>
  <UserName>iqbal1</UserName>
  <OwnerID>{57F3B9B1-86F1-4fcc-B1EE-566DE1813D20}</OwnerID>
  <FileID>{90A44FB5-33D9-4815-AC85-BC87A7E7D1EB}</FileID>
  <QBType>QBFS</QBType>
  <Scheduler>
    <RunEveryNMinutes>2</RunEveryNMinutes>
  </Scheduler>
</QBWCXML>

Second step - wsimport QBWebConnectorSvc.wsdl

To build a Web services from the WSDL will use the wsimport , which will generate the JAX-WS compatible Web Services.
The WSDL for Web Services is available at url developer.intuit.com/uploadedFiles/Support/QBWebConnectorSvc.wsdl.
To start I created a Basic Java project with Eclipse "File -> New -> Java Project -> JavaQuickBooksWebConnector".
cd /Users/pablo/workspace/JavaQuickBooksWebConnector/src/

wsimport qbwebconnectorsvc.wsdl -s . -p com.mepprime.quickbooks.ws
Parameters
  • -s to specify the directory where you will be generating the source code
  • -p to specify the package

No comments:

Post a Comment