php - QUICKBOOKS_ADD_CUSTOMER function doesn't trigger (“no data exchange”) -
i'm trying synchronize opencart qb desktop. doesn't work. qb web connector says "no data exchange".
here code:
// map quickbooks actions handler functions $map = array( quickbooks_add_customer => array( '_quickbooks_customer_add_request', '_quickbooks_customer_add_response' ), ); $errmap = array( '*' => '_quickbooks_error_catchall', ); $hooks = array(); $log_level = quickbooks_log_develop; $soapserver = quickbooks_soapserver_builtin $soap_options = array(); $handler_options = array( 'deny_concurrent_logins' => false, 'deny_reallyfast_logins' => false, ); // see comments in quickbooks/server/handlers.php file $driver_options = array( // see comments in quickbooks/driver/<your driver here>.php file ( i.e. 'mysql.php', etc. ) 'max_log_history' => 32000, // limit number of quickbooks_log entries 1024 'max_queue_history' => 1024, // limit number of *successfully processed* quickbooks_queue entries 64 ); $callback_options = array(); // set our queue singleton quickbooks_webconnector_queue_singleton::initialize($dsn); $server = new quickbooks_webconnector_server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, quickbooks_wsdl, $soap_options, $handler_options, $driver_options, $callback_options); $response = $server->handle(true, true); function _quickbooks_customer_add_request($requestid, $user, $action, $id, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale) { // grab data our mysql database $arr = array( 'name' => 'opencart' . date('ymdhis'), 'fname' => 'opencart'. date('ymdhis'), 'lname' => 'opencart'. date('ymdhis'), ); $xml = '<?xml version="1.0" encoding="utf-8"?> <?qbxml version="2.0"?> <qbxml> <qbxmlmsgsrq onerror="stoponerror"> <customeraddrq requestid="' . $requestid . '"> <customeradd> <name>' . $arr['name'] . '</name> <companyname>' . $arr['name'] . '</companyname> <firstname>' . $arr['fname'] . '</firstname> <lastname>' . $arr['lname'] . '</lastname> </customeradd> </customeraddrq> </qbxmlmsgsrq> </qbxml>'; return $xml; }
here test handle.php code queue new customer:
if (isset($_get['customer_id'])) { $id = intval($_get['customer_id']); // queue customer add $queue = new quickbooks_webconnector_queue($dsn); $queue->enqueue(quickbooks_add_customer, $id); die('great, queued customer!'); }
it adds new record database:
quickbooks_queue_id = 609 quickbooks_ticket_id = null qb_username = someuser qb_action = customeradd ident = 123456 = empty qbxml = empty priority = 0 qb_status = q enqueue_datetime = 2016-02-02 20:58:50 dequeue_datetime = null
web connector log:
20160204.06:45:32 utc : qbwebconnector.webservicemanager.doupdateselected() : updatews() application = 'quickbooks bridge opencart' has started 20160204.06:45:32 utc : qbwebconnector.registrymanager.getupdatelock() : hkey_current_user\software\intuit\qbwebconnector\updatelock = false 20160204.06:45:32 utc : qbwebconnector.registrymanager.setupdatelock() : hkey_current_user\software\intuit\qbwebconnector\updatelock has been set true 20160204.06:45:32 utc : qbwebconnector.registrymanager.setupdatelock() : ********************* update session locked ********************* 20160204.06:45:32 utc : qbwebconnector.soapwebservice.instantiatewebservice() : initiated connection following application. 20160204.06:45:32 utc : qbwebconnector.soapwebservice.instantiatewebservice() : appname: quickbooks bridge opencart 20160204.06:45:32 utc : qbwebconnector.soapwebservice.instantiatewebservice() : appuniquename (if available): quickbooks bridge opencart 20160204.06:45:32 utc : qbwebconnector.soapwebservice.instantiatewebservice() : appurl: https://example.com/qbwc.php 20160204.06:45:32 utc : qbwebconnector.soapwebservice.do_serverversion() : *** calling serverversion(). 20160204.06:45:32 utc : qbwebconnector.soapwebservice.do_serverversion() : received serverversion() following parameter:<serverversionret="php quickbooks soap server v3.0 @ /wce/qbwc.php"> 20160204.06:45:32 utc : qbwebconnector.soapwebservice.do_clientversion() : *** calling clientversion() following parameter:<productversion="2.2.0.34"> 20160204.06:45:33 utc : qbwebconnector.soapwebservice.do_clientversion() : received clientversion() following parameter:<clientversionret=""> 20160204.06:45:33 utc : qbwebconnector.soapwebservice.do_clientversion() : application agrees current version of qbwebconnector. allowing update operation. 20160204.06:45:33 utc : qbwebconnector.soapwebservice.do_authenticate() : authenticating application 'quickbooks bridge opencart', username = 'someuser' 20160204.06:45:33 utc : qbwebconnector.soapwebservice.do_authenticate() : *** calling authenticate() following parameters:<username="someuser"><password=<maskedforsecurity> 20160204.06:45:33 utc : qbwebconnector.soapwebservice.updatews() : received authenticate() following parameters:<authret[0]="1c44d47f-1542-1854-3d22-0d9569718c76"><authret[1]="13355f1b-4b26-4a7b-b182-15c6dd1246f9"><authret[2]="1"><authret[3]=""> 20160204.06:45:33 utc : qbwebconnector.registrymanager.setcurrentwebservicename() : hkey_current_user\software\intuit\qbwebconnector\currentwebservicename has been set quickbooks bridge opencart 20160204.06:45:33 utc : qbwebconnector.registrymanager.setcurrentwebservicesessionticket() : hkey_current_user\software\intuit\qbwebconnector\currentwebservicesessionticket has been set 1c44d47f-1542-1854-3d22-0d9569718c76 20160204.06:45:33 utc : qbwebconnector.soapwebservice.checkcfnresponse() : user authenticated. 20160204.06:45:33 utc : qbwebconnector.soapwebservice.handledelayrequest() : update has been postponed @ 2/3/2016 10:45:33 pm 'quickbooks bridge opencart' next 60 seconds 20160204.06:45:33 utc : qbwebconnector.soapwebservice.do_authenticate() : done. 20160204.06:45:33 utc : qbwebconnector.registrymanager.setupdatelock() : hkey_current_user\software\intuit\qbwebconnector\updatelock has been set false 20160204.06:45:33 utc : qbwebconnector.registrymanager.setupdatelock() : ********************* update session unlocked ********************* 20160204.06:45:33 utc : qbwebconnector.webservicemanager.doupdateselected() : no data exchange application: quickbooks bridge opencart
i've added die()
_quickbooks_customer_add_request
ignores function.
does know how solve this? thank you.
anytime "no data exchange required." means there's nothing in queue web connector process, or have badly misconfigured.
since do have records in quickbooks_queue
table, first guess web connector connecting different user what's in queue table.
can confirm .qwc file used uses username?
someuser
short of that, have misconfigured. based on logs, looks have misconfigured. specifically:
qb_company_file: 13355f1b-4b26-4a7b-b182-15c6dd1246f9;
this should file path pointing quickbooks company file (hit f2 in quickbooks see it) or should empty. value not valid windows file path.
also, this:
qwbc_min_run_every_n_seconds: 60
remove this. should not have set either unless have good, specific reason doing so. incompatible several versions of web connector.
did follow quick-start guide? not run these issues if had...
Comments
Post a Comment