Quickbooks 快速图书进口项目&;发票

Quickbooks 快速图书进口项目&;发票,quickbooks,Quickbooks,我有QuickBooks 2010 pro版,正如标题所示,我需要将产品和发票导入QuickBooks 一些背景… 我们是一家在线公司,在线销售产品,我的客户希望将所有产品导入quickbooks,并将每次在线销售导入quickbooks,我们的网站是使用ASP.NET和SQL Server作为备份构建的 我是quickbooks的新手,所以我不知道从这里该做什么 我听说过IIF import&SDK,不幸的是,我找不到关于它们的有价值的文档。谁能告诉我正确的方向(也许是一些示例代码)?请不要给

我有QuickBooks 2010 pro版,正如标题所示,我需要将产品和发票导入QuickBooks

一些背景…

我们是一家在线公司,在线销售产品,我的客户希望将所有产品导入quickbooks,并将每次在线销售导入quickbooks,我们的网站是使用ASP.NET和SQL Server作为备份构建的

我是quickbooks的新手,所以我不知道从这里该做什么

我听说过IIF import&SDK,不幸的是,我找不到关于它们的有价值的文档。谁能告诉我正确的方向(也许是一些示例代码)?请不要给我quickbooks网站的SDK url


谢谢

如果您不愿意查看QuickBooks SDK,那么您将给自己带来巨大的伤害

实现您要做的事情的最简单方法是通过SDK和Web连接器。在我们的维基上有一个基本的概述。它专门用于将数据从在线网站移动到QuickBooks for Windows(就像您正在尝试的那样)。其基本思想是,它轮询您的网站,要求您做一些事情,您可以向它提供XML请求来做一些事情(添加客户、添加发票等)

基本协议如下所示:

//Web连接器要求SOAP服务对Web连接器进行身份验证 =>SOAP服务器:使用用户名“xyz”和密码“bla”进行身份验证(身份验证) 如果身份验证成功,SOAP服务器将返回一个票证值并继续该过程

//Web连接器要求执行某些操作Web连接器=>SOAP 服务器:嘿,SOAP服务器,你有什么事要我做? (sendRequestXML) SOAP服务器生成并返回qbXML请求

//Web连接器将该请求中继到QuickBooks,并接收 来自QuickBooks Web连接器的响应=>QuickBooks:hey QuickBooks,SOAP服务器给了我这个请求,可以吗 处理它? QuickBooks处理该请求,并将响应返回给Web连接器

//Web连接器将来自QuickBooks的响应中继回SOAP 服务器Web连接器=>SOAP服务器:嘿,SOAP服务器,下面是 对来自QuickBooks的最后一个请求的响应(ReceiverResponseXml) SOAP服务器处理响应,处理任何错误并对响应执行任何操作 SOAP服务器返回完成百分比,如果小于100%,此过程将继续

//该过程重新开始,Web连接器询问SOAP 下一个请求的服务器。。。Web连接器=>SOAP服务器:嘿 SOAP服务器,你还有什么要我做的?(sendRequestXML) SOAP服务器生成并返回qbXML请求

。。。诸如此类

如果你下载(哎哟,对不起!),你会发现它包含了一些你想要的东西。具体而言,该目录中有一个示例代码:

C:\Program Files (x86)\Intuit\IDN\QBSDK12.0\samples\qbdt\c-sharp\qbXML\WCWebService
下面是该示例代码中内容的一个经过清理、精简的版本:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.IO;
using System.Security.Cryptography;
using Microsoft.Win32;
using System.Xml;
using System.Text.RegularExpressions;

namespace WCWebService
{
    /// <summary>
    /// Web Service Namespace="http://developer.intuit.com/"
    /// Web Service Name="WCWebService"
    /// Web Service Description="Sample WebService in ASP.NET to 
    /// demonstrate QuickBooks WebConnector"
    /// </summary>
    [WebService(
         Namespace="http://developer.intuit.com/",
         Name="WCWebService",
         Description="Sample WebService in ASP.NET to demonstrate " + 
                "QuickBooks WebConnector")]

    // Important Note:  
    // You should keep the namespace as http://developer.intuit.com/ for all web 
    // services that communicates with QuickBooks Web Connector. 


    public class WCWebService : System.Web.Services.WebService
    {
        ...

        #region WebMethods
        [WebMethod]
        /// <summary>
        /// WebMethod - authenticate()
        /// To verify username and password for the web connector that is trying to connect
        /// Signature: public string[] authenticate(string strUserName, string strPassword)
        /// 
        /// IN: 
        /// string strUserName 
        /// string strPassword
        ///
        /// OUT: 
        /// string[] authReturn
        /// Possible values: 
        /// string[0] = ticket
        /// string[1]
        /// - empty string = use current company file
        /// - "none" = no further request/no further action required
        /// - "nvu" = not valid user
        /// - any other string value = use this company file
        /// </summary>
        public string[] authenticate(string strUserName, string strPassword)
        {
            string[] authReturn = new string[2];

            // Code below uses a random GUID to use as session ticket
            // An example of a GUID is {85B41BEE-5CD9-427a-A61B-83964F1EB426}
            authReturn[0]= System.Guid.NewGuid().ToString();

            // For simplicity of sample, a hardcoded username/password is used.
            // In real world, you should handle authentication in using a standard way. 
            // For example, you could validate the username/password against an LDAP 
            // or a directory server
            string pwd="password";

            if (strUserName.Trim().Equals("username") && strPassword.Trim().Equals(pwd))
            {
                // An empty string for authReturn[1] means asking QBWebConnector 
                // to connect to the company file that is currently openned in QB
                authReturn[1]="";
            }
            else
            {
                authReturn[1]="nvu";
            }

            // You could also return "none" to indicate there is no work to do
            // or a company filename in the format C:\full\path\to\company.qbw
            // based on your program logic and requirements.
            return authReturn;
        }

        [ WebMethod(Description="This web method facilitates web service to send request XML to QuickBooks via QBWebConnector",EnableSession=true) ]
        /// <summary>
        /// WebMethod - sendRequestXML()
        /// Signature: public string sendRequestXML(string ticket, string strHCPResponse, string strCompanyFileName, 
        /// string Country, int qbXMLMajorVers, int qbXMLMinorVers)
        /// 
        /// IN: 
        /// int qbXMLMajorVers
        /// int qbXMLMinorVers
        /// string ticket
        /// string strHCPResponse 
        /// string strCompanyFileName 
        /// string Country
        /// int qbXMLMajorVers
        /// int qbXMLMinorVers
        ///
        /// OUT:
        /// string request
        /// Possible values: 
        /// - “any_string” = Request XML for QBWebConnector to process
        /// - "" = No more request XML 
        /// </summary>
        public string sendRequestXML(string ticket, string strHCPResponse, string strCompanyFileName, 
            string qbXMLCountry, int qbXMLMajorVers, int qbXMLMinorVers)
        {
            ... build some qbXML request here and return it ...

            return request;
        }



        [ WebMethod(Description="This web method facilitates web service to receive response XML from QuickBooks via QBWebConnector",EnableSession=true) ]
        /// <summary>
        /// WebMethod - receiveResponseXML()
        /// Signature: public int receiveResponseXML(string ticket, string response, string hresult, string message)
        /// 
        /// IN: 
        /// string ticket
        /// string response
        /// string hresult
        /// string message
        ///
        /// OUT: 
        /// int retVal
        /// Greater than zero  = There are more request to send
        /// 100 = Done. no more request to send
        /// Less than zero  = Custom Error codes
        /// </summary>
        public int receiveResponseXML(string ticket, string response, string hresult, string message)
        {
            ... process the response from QuickBooks here, and return an integer ... 

            return retVal;
        }
        #endregion

    } // class: WCWebService
} // namespace: WCWebService
使用系统;
使用系统集合;
使用系统组件模型;
使用系统数据;
使用系统诊断;
使用System.Web;
使用System.Web.Services;
使用System.IO;
使用System.Security.Cryptography;
使用Microsoft.Win32;
使用System.Xml;
使用System.Text.RegularExpressions;
命名空间Web服务
{
/// 
///Web服务命名空间=”http://developer.intuit.com/"
///Web服务名称=“WCWebService”
///Web服务描述=“ASP.NET中的示例Web服务到
///演示QuickBooks网络连接器“
/// 
[网络服务](
名称空间=”http://developer.intuit.com/",
Name=“WCWebService”,
Description=“要演示的ASP.NET中的示例Web服务”+
“QuickBooks网络连接器”)]
//重要提示:
//您应该将名称空间保持为http://developer.intuit.com/ 万维网
//与QuickBooks Web连接器通信的服务。
公共类WCWebService:System.Web.Services.WebService
{
...
#区域网络方法
[网络方法]
/// 
///WebMethod-authenticate()
///验证尝试连接的web连接器的用户名和密码
///签名:公共字符串[]身份验证(字符串strUserName、字符串strPassword)
/// 
///在:
///字符串结构名
///字符串strPassword
///
///输出:
///字符串[]authReturn
///可能值:
///字符串[0]=票证
///字符串[1]
///-空字符串=使用当前公司文件
///-“无”=无进一步请求/无需采取进一步行动
///-“nvu”=无效用户
///-任何其他字符串值=使用此公司文件
/// 
公共字符串[]身份验证(字符串strUserName、字符串strPassword)
{
字符串[]authReturn=新字符串[2];
//下面的代码使用随机GUID作为会话票证
//GUID的示例是{85B41BEE-5CD9-427a-A61B-83964F1EB426}
authReturn[0]=System.Guid.NewGuid().ToString();
//为了简化示例,使用了硬编码的用户名/密码。
//在现实世界中,您应该使用标准方式处理身份验证。
//例如,您可以根据LDAP验证用户名/密码
//或目录服务器
字符串pwd=“密码”;
if(strUserName.Trim().Equals(“用户名”)&&strPassword.Trim().Equals(pwd))
{
//authReturn[1]的空字符串表示询问QBWebConnector
//连接到当前在QB中打开的公司文件
authReturn[1]=“”;
}
其他的
{
authReturn[1]=“nvu”;
}
//您也可以在中将“无”返回到