// This *must* be httpS:// (path to your QuickBooks SOAP server) $appurl = 'https://' . str_replace('//', '/', $_SERVER['HTTP_HOST'] . '' . dirname($_SERVER['REQUEST_URI']) . '/' . basename($_SERVER['PHP_SELF'], '_qwc.php') . '_server.php'); if (false !== strpos($_SERVER['HTTP_HOST'], 'localhost')) { $appurl = str_replace('https://', 'http://', $appurl); } $appsupport = $appurl . '?support=1'; if (false !== strpos($appurl, '?')) { // This *must* be httpS:// and the domain name must match the domain name above $appsupport = $appurl . '&support=1'; } $username = '******'; // This is the username you stored in the 'quickbooks_user' table by using QuickBooks_Utilities::createUser() //$fileid = '57F3B9B6-86F1-4FCC-B1FF-966DE1813D20'; // Just make this up, but make sure it keeps that format //$ownerid = '57F3B9B6-86F1-4FCC-B1FF-166DE1813D20'; // Just make this up, but make sure it keeps that format $fileid = QuickBooks_QWC::GUID(); $ownerid = QuickBooks_QWC::GUID(); $qbtype = QUICKBOOKS_TYPE_QBFS; // You can leave this as-is unless you're using QuickBooks POS $readonly = false; // No, we want to write data to QuickBooks $run_every_n_seconds = 600; // Run every 600 seconds (10 minutes) // Generate the XML file $QWC = new QuickBooks_QWC($name, $descrip, $appurl, $appsupport, $username, $fileid, $ownerid, $qbtype, $readonly, $run_every_n_seconds); $xml = $QWC->generate(); // Send as a file download //header('Content-Type: text/plain'); header('Content-type: text/xml'); header('Content-Disposition: attachment; filename="QuickBooks-SQL-Mirror_' . $_SERVER['HTTP_HOST'] . '.qwc"'); print $xml; exit;
/** * Generate a random GUID string * * @deprecated Use the QuickBooks_QWC class instead */ public static function generateGUID($surround = true) { return QuickBooks_QWC::GUID($surround); }