【问题标题】:Consolibyte Quickbooks PHP SDK (web connector) - Authentication failedConsolibyte Quickbooks PHP SDK(Web 连接器)- 身份验证失败
【发布时间】:2020-03-19 12:44:34
【问题描述】:

我正在使用 Consolibyte 的用于 Quick Books Desktop 的 PHP 开发工具包,但身份验证失败并显示以下消息: 20200319.12:39:20 UTC:QBWebConnector.SOAPWebService.do_authenticate():QBWC1012:由于以下错误消息,身份验证失败。 请求失败,HTTP 状态 403:禁止。

.QWC 文件:

<?xml version="1.0"?>
<QBWCXML>
	<AppName>Local Netexem</AppName>
	<AppID></AppID>
	<AppURL>https://bitsclan-solutions.com/quickbooks/qbwc</AppURL>
	<AppDescription>Netexem Quickbooks</AppDescription>
	<AppSupport>https://bitsclan-solutions.com/quickbooks/qbwc</AppSupport>
	<UserName>username</UserName>
	<OwnerID>{b7177e65-2f70-a214-214c-aed509cd911e}</OwnerID>
	<FileID>{ba656061-e8a4-0a24-95fa-aa6c74b5f6b9}</FileID>
	<QBType>QBFS</QBType>
	<Notify>false</Notify>
	<Scheduler>
		<RunEveryNMinutes>1</RunEveryNMinutes>
	</Scheduler>
	<IsReadOnly>false</IsReadOnly>
</QBWCXML>

QWC 日志:

20200322.23:31:33 UTC	: QBWebConnector.WebServiceManager.DoUpdateSelected() : updateWS() for application = 'Local Netexem' has STARTED
20200322.23:31:33 UTC	: QBWebConnector.RegistryManager.getUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock = FALSE
20200322.23:31:33 UTC	: QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to True
20200322.23:31:33 UTC	: QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session locked *********************
20200322.23:31:33 UTC	: QBWebConnector.SOAPWebService.instantiateWebService() : Initiated connection to the following application.
20200322.23:31:33 UTC	: QBWebConnector.SOAPWebService.instantiateWebService() : AppName: Local Netexem
20200322.23:31:33 UTC	: QBWebConnector.SOAPWebService.instantiateWebService() : AppUniqueName (if available): Local Netexem
20200322.23:31:33 UTC	: QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: https://bitsclan-solutions.com/quickbooks/qbwc
20200322.23:31:33 UTC	: QBWebConnector.SOAPWebService.do_serverVersion() : *** Calling serverVersion().
20200322.23:31:34 UTC	: QBWebConnector.SOAPWebService.do_serverVersion() : Actual error received from web service for serverVersion call: <Client found response content type of 'text/xml;charset=UTF-8', but expected 'text/xml'.
The request failed with an empty response.>. For backward compatibility of all webservers, QBWC will catch all errors under app-not-supporting-serverVersion.
20200322.23:31:34 UTC	: QBWebConnector.SOAPWebService.do_serverVersion() : This application does not contain support for serverVersion. Allowing update operation for backward compatibility.
20200322.23:31:34 UTC	: QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.3.0.36">
20200322.23:31:34 UTC	: QBWebConnector.SOAPWebService.updateWS() : Actual error received from web service for clientVersion call: <Client found response content type of 'text/xml;charset=UTF-8', but expected 'text/xml'.
The request failed with an empty response.>. For backward compatibility of all webservers, QBWC will catch all errors under app-not-supporting-clientVersion.
20200322.23:31:34 UTC	: QBWebConnector.SOAPWebService.do_clientVersion() : This application does not contain support for clientVersion. Allowing update operation for backward compatibility.
20200322.23:31:34 UTC	: QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'Local Netexem', username = 'username'
20200322.23:31:34 UTC	: QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="username"><password=<MaskedForSecurity>
20200322.23:31:35 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
20200322.23:31:35 UTC	: QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
20200322.23:31:35 UTC	: QBWebConnector.RegistryManager.setUpdateLock() : ********************* Update session unlocked *********************
20200322.23:31:35 UTC	: QBWebConnector.WebServiceManager.DoUpdateSelected() : Update completed with errors. See log (QWClog.txt) for details.

【问题讨论】:

    标签: php web quickbooks connector intuit


    【解决方案1】:

    这个:The request failed with HTTP status 403: Forbidden.

    表示您有:

    1. Web 服务器配置错误,拒绝对您的 URL 的 POST 请求
    2. 发送403 Forbidden 标头的PHP 脚本(可能通过https://www.php.net/header

    修复您的代码或网络服务器配置。

    如果您尝试将POST 发送到该 URL,您会得到以下结果:

    您应该确定这是否是 您的代码 正在生成的 403 Forbidden 页面(也许您正在使用诸如 Laravel 或 CodeIgnitor 之类的框架或生成此页面的东西?)或其他东西您的网络主机正在生产。

    【讨论】:

    • 谢谢! 403 禁止错误已解决,我将项目转移到另一个域,现在我收到“QBWC1012:由于以下错误消息,身份验证失败。客户端 fou......”
    • 你真的访问过那个网址吗?你print_r正在做一些你不应该做的事情。如果您需要更多帮助,请发布您的代码。
    猜你喜欢
    • 2016-03-19
    • 2019-07-16
    • 1970-01-01
    • 1970-01-01
    • 2010-09-12
    • 2015-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多