首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QuickBooks DevKit连接错误

QuickBooks DevKit连接错误
EN

Stack Overflow用户
提问于 2014-02-05 22:37:52
回答 1查看 1.3K关注 0票数 0

我一直试图同步QB连接器,但我一直收到错误:

第一个是:‘致命错误:类'QuickBooks_Loader’not‘,我通过在页面顶部添加文件位置来修正这个错误:include_once("$_SERVER[DOCUMENT_ROOT]/qb/QuickBooks/Loader.php");

现在,我从web连接器获得了以下错误:

QBWC1012:由于以下错误消息,身份验证失败。客户端找到了“text/html”的响应内容类型,但期望“text/xml”。请求失败,响应为空。有关更多详细信息,请参阅QWCLog。记得打开日志。

我检查了所有的文件,以确保内容类型是text/xml,仍然没有骰子。请帮帮忙。

代码语言:javascript
复制
<?php

/**
 * Example of generating QuickBooks *.QWC files 
 * 
 * @author Keith Palmer <keith@consolibyte.com>
 * 
 * @package QuickBooks
 * @subpackage Documentation
 */

// Error reporting... 
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);

/**
 * Require the utilities class
 */
require_once '../QuickBooks.php';

$name = 'My QuickBooks SOAP Server';                // A name for your server (make it whatever you want)
$descrip = 'An example QuickBooks SOAP Server';     // A description of your server 

$appurl = 'https://www.domain.com/qb/QuickBooks/SOAP/Server.php';       // This *must* be httpS:// (path to your QuickBooks SOAP server)
$appsupport = 'https://www.domain.com';         // This *must* be httpS:// and the domain name must match the domain name above

$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

$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_WebConnector_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/xml');
header('Content-Disposition: attachment; filename="my-quickbooks-wc-file.qwc"');
print($xml);
exit;
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-06 12:28:42

您使用的URL:

代码语言:javascript
复制
$appurl = 'https://www.domain.com/qb/QuickBooks/SOAP/Server.php';

不是正确的URL。

如果您引用快速启动指南,您将注意到它必须将Web指向以下脚本:

代码语言:javascript
复制
docs/example_web_connector.php

这就是应该在您的AppURL中的脚本。示例脚本是一个实际的SOAP端点,它将允许来自Web连接器的连接。相反,您已经将Web连接器指向一个库文件,该库文件本身不执行任何操作,您不需要在任何地方触摸或引用这些文件。

顺便说一句,这也是你不得不添加include_once行的原因--如果您的Web指向正确的位置,您就不需要这样做了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21590104

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档