使用 Quickbook 连接器和 nodejs 的 Quickbook(桌面)API 集成 [英] Quickbook(desktop) API integration using Quickbook connector and nodejs
问题描述
我是 Quickbooks 的新手,但我已经在 Quickbook Premier 桌面版上安装并拥有一个帐户以及 Quickbook 连接器.我正在尝试通过可用的 Quickbook 连接器将我的自定义应用程序中的发票、估算和客户信息同步到 Quickbooks.问题是,Quickbook 连接器不接受我的应用程序返回的 SOAP xml 响应,因为它们的格式可能不同,所以我想为此使用 nodejs 创建一个服务网关,其中该中间层可以根据到 Quickbook 连接器接受的格式.有一个限制,我不能直接更改我的应用程序生成 SOAP 响应的格式.所以任何人都可以建议从哪里开始,如果我正在朝着正确的方向思考.提前致谢!
I am new to Quickbooks but I have already installed and have an account on Quickbook Premier Desktop Edition along with the Quickbook connector in place. I am trying to sync up the Invoices, Estimates and Customer information from my custom application into Quickbooks via the Quickbook connector that is available. The thing is, the SOAP xml response returned by my application is not accepted by the Quickbook connector as they might differ in format, So i wanted to create a service gateway for this using nodejs preferably wherein this middle tier can process and convert the SOAP according to the format that Quickbook connector accepts. There is a limitation that i cannot directly change the format in which my app is generating the SOAP response. So can anybody suggest where to start and if at all I am thinking in the right direction. Thanks in advance!
推荐答案
使用 soap 包,像这样构建你的服务:
Using the soap package, structure your service like so:
var soap = require('soap');
var yourService = {
QBWebConnectorSvc: {
QBWebConnectorSvcSoap: {
serverVersion: function (args) {
// serverVersion code here
return {
serverVersionResult: { string: retVal }
};
},
clientVersion: function (args) {
//clientVersion code here
return {
clientVersionResult: { string: retVal }
};
},
// and all other service functions required by QBWC
}
}
};
var soapServer = soap.listen(server, '/path-to-your-wsdl', yourService, xml);
以下是 clientVersion()
的示例响应,应该看起来像使用该结构:
Here's a sample response for clientVersion()
should look like using that structure:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://developer.intuit.com/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/">
<soap:Body>
<tns:clientVersionResponse xmlns:tns="http://developer.intuit.com/" xmlns="http://developer.intuit.com/">
<tns:clientVersionResult>
<tns:string></tns:string>
</tns:clientVersionResult>
</tns:clientVersionResponse>
</soap:Body>
</soap:Envelope>
我已经编写了一个功能实现,它可用 此处.
I've written a functional implementation, it's available here.
这篇关于使用 Quickbook 连接器和 nodejs 的 Quickbook(桌面)API 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!