I'm trying to use this system to sync my database from postgresql to quickbooks web connector https://github.com/consolibyte/quickbooks-php, but it's giving me all sorts of XML issues.
Here is my QWC file:
<?xml version="1.0"?>
<QBWCXML>
<AppName>QuickBooks PostgreSQL Mirror</AppName>
<AppID></AppID>
<AppURL>https://myserver.com/admin/qbwc/pgsql_server.php</AppURL>
<AppDescription>QuickBooks PostgreSQL Mirror</AppDescription>
<AppSupport>https://myserver.com/admin/qbwc/pgsql_server.php?support=1</AppSupport>
<UserName>quickbooks</UserName>
<OwnerID>{fb0c8866-7719-e4a4-e9bb-c81c30cd1045}</OwnerID>
<FileID>{788e593c-0b38-4824-3d7d-5b9a793316df}</FileID>
<QBType>QBFS</QBType>
<Notify>true</Notify>
<Scheduler>
<RunEveryNMinutes>1</RunEveryNMinutes>
</Scheduler>
<IsReadOnly>false</IsReadOnly>
</QBWCXML>
Here is my PHP connector app, copied from the example file for PostgreSQL syncing, but modified with my info:
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 0);
require_once '../libraries/vendor/consolibyte/quickbooks/QuickBooks.php';
if (function_exists('date_default_timezone_set'))
{
date_default_timezone_set('America/Detroit');
}
$username = 'quickbooks';
$password = 'password';
$dsn = 'pgsql://postgres:password@localhost/quickbooks';
if (!QuickBooks_Utilities::initialized($dsn))
{
header('Content-Type: text/plain');
set_time_limit(0);
$driver_options = array(
);
$init_options = array(
'quickbooks_sql_enabled' => true,
);
QuickBooks_Utilities::initialize($dsn, $driver_options, $init_options);
QuickBooks_Utilities::createUser($dsn, $username, $password);
exit;
}
$mode = QuickBooks_WebConnector_Server_SQL::MODE_READWRITE;
$conflicts = QuickBooks_WebConnector_Server_SQL::CONFLICT_LOG;
$delete = QUICKBOOKS_SERVER_SQL_DELETE_FLAG;
$hooks = array();
$soap_options = array();
$handler_options = array(
'deny_concurrent_logins' => false,
'deny_reallyfast_logins' => false,
);
$driver_options = array();
$sql_options = array(
'only_import' => array(
QUICKBOOKS_OBJECT_CUSTOMER,
),
'only_add' => array(
QUICKBOOKS_OBJECT_CUSTOMER,
),
'only_modify' => array(
QUICKBOOKS_OBJECT_CUSTOMER,
),
);
$callback_options = array();
$Server = new QuickBooks_WebConnector_Server_SQL(
$dsn,
'1 minute',
$mode,
$conflicts,
$delete,
$username,
array(),
array(),
$hooks,
QUICKBOOKS_LOG_DEVELOP,
QUICKBOOKS_SOAPSERVER_BUILTIN,
QUICKBOOKS_WSDL,
$soap_options,
$handler_options,
$driver_options,
$sql_options,
$callback_options);
header('Content-Type: text/xml');
ob_start();
$Server->handle(true, true);
print(ob_get_clean());
exit;
I know it runs and connects to my DB, since I have all the qb_
tables added, but no data is syncing back and forth. I also get this error whenever I run it:
Here are my logs:
20210526.15:53:01 UTC : QBWebConnector.WebServiceManager.DoUpdateSelected() : updateWS() for application = 'QuickBooks PostgreSQL Mirror - myserver.com' has STARTED
20210526.15:53:01 UTC : QBWebConnector.RegistryManager.getUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock = FALSE
20210526.15:53:01 UTC : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to True
20210526.15:53:01 UTC : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session locked *********************
20210526.15:53:01 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : Initiated connection to the following application.
20210526.15:53:01 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppName: QuickBooks PostgreSQL Mirror - myserver.com
20210526.15:53:01 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppUniqueName (if available): QuickBooks PostgreSQL Mirror - myserver.com
20210526.15:53:01 UTC : QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: https://myserver.com/admin/qbwc/pgsql_server.php
20210526.15:53:01 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : *** Calling serverVersion().
20210526.15:53:02 UTC : QBWebConnector.SOAPWebService.do_serverVersion() : Received from serverVersion() following parameter:<serverVersionRet="PHP QuickBooks SOAP Server v3.0 at /admin/qbwc/pgsql_server.php">
20210526.15:53:02 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.3.0.198">
20210526.15:53:02 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : Received from clientVersion() following parameter:<clientVersionRet="">
20210526.15:53:02 UTC : QBWebConnector.SOAPWebService.do_clientVersion() : This application agrees with the current version of QBWebConnector. Allowing update operation.
20210526.15:53:02 UTC : QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'QuickBooks PostgreSQL Mirror - myserver.com', username = 'quickbooks'
20210526.15:53:02 UTC : QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="quickbooks"><password=<MaskedForSecurity>
20210526.15:53:02 UTC : QBWebConnector.SOAPWebService.do_authenticate() : QBWC1012: Authentication failed due to following error message.
Client found response content type of 'text/xml;charset=UTF-8', but expected 'text/xml'.
The request failed with an empty response.
More info:
StackTrace = at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at QBWebConnector.localhost.WCWebServiceDoc.authenticate(String strUserName, String strPassword)
at QBWebConnector.localhost.WCWebService.authenticate(String strUserName, String strPassword)
at QBWebConnector.SOAPWebService.authenticate(String UserName, String Password)
at QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName)
Source = System.Web.Services
20210526.15:53:02 UTC : QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
20210526.15:53:02 UTC : QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session unlocked *********************
20210526.15:53:02 UTC : QBWebConnector.WebServiceManager.DoUpdateSelected() : Update completed with errors. See log (QWClog.txt) for details.