问题描述
我正在尝试使用此系统将我的数据库从 postgresql 同步到 quickbooks 网络连接器 https://github.com/consolibyte/quickbooks-php,但它给我带来了各种 XML 问题。
这是我的 QWC 文件:
<?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>
这是我的 PHP 连接器应用程序,从用于 Postgresql 同步的示例文件复制,但使用我的信息进行了修改:
<?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,array(),$hooks,QUICKBOOKS_LOG_DEVELOP,QUICKBOOKS_SOAPSERVER_BUILTIN,QUICKBOOKS_WSDL,$soap_options,$handler_options,$sql_options,$callback_options);
header('Content-Type: text/xml');
ob_start();
$Server->handle(true,true);
print(ob_get_clean());
exit;
我知道它运行并连接到我的数据库,因为我添加了所有 qb_
表,但没有数据来回同步。每当我运行它时,我也会收到此错误:
这是我的日志:
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.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)