首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >QBWC1012:由于以下错误消息,身份验证失败。索引超出了数组的界限。

QBWC1012:由于以下错误消息,身份验证失败。索引超出了数组的界限。
EN

Stack Overflow用户
提问于 2017-08-11 22:04:08
回答 1查看 1.1K关注 0票数 0

我正在使用WebConnector2.1.0.30作为中介将QuickBooks桌面企业与一个web应用程序集成在一起。我在中用WCF开发的SOAP服务,以及Web连接器对我的服务的访问没有问题,这里我展示了web连接器的执行日志

区块引用20170811.21:39:26 UTC : QBWebConnector.WebServiceManager.DoUpdateSelected():updateWS()用于应用= 'WCService‘已启动20170811.21:39:26 UTC : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock = FALSE 20170811.21:39:26 UTC : QBWebConnector.RegistryManager.setUpdateLock():HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock已设置为True 20170811.21:39:26 UTC :QBWebConnector.RegistryManager。():*更新会话锁定* 20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.instantiateWebService():已启动到以下应用程序的连接。20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.instantiateWebService():AppName: WCService 20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.instantiateWebService():AppUniqueName (如果有的话):WCService 20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.instantiateWebService():AppURL:http://localhost:14319/WCService.svc 20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.do_serverVersion():Calling ()。20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.do_serverVersion():从serverVersion()接收到以下参数: 20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.do_clientVersion():调用具有以下参数的clientVersion():20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.do_clientVersion():从clientVersion()接收到以下参数: 20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.do_clientVersion():此应用程序符合QBWebConnector的当前版本。允许更新操作。20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.do_authenticate():身份验证到应用程序'WCService',用户名= 'Dalo‘20170811.21:39:26 UTC : QBWebConnector.SOAPWebService.do_authenticate():*使用以下参数调用():**20170811.21:39:28 UTC : QBWebConnector.SOAPWebService.do_authenticate():QBWC1012:身份验证因以下错误消息而失败。更多信息: StackTrace = en StackTrace票证QBWebConnector.RegistryManager.setUpdateLock():HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock被设置为False 20170811.21:39:28 UTC : QBWebConnector.RegistryManager.setUpdateLock():*更新会话解锁* 20170811.21:39:28UTC : QBWebConnector.WebServiceManager.DoUpdateSelected():用错误完成更新。有关详细信息,请参阅日志(QWClog.txt)。区块报价

现在我向您展示我的QWC文件。

代码语言:javascript
运行
复制
<?xml version="1.0"?>
<QBWCXML>
  <AppDescription>QB Web Service</AppDescription>
  <AppID></AppID>
  <AppName>WCService</AppName>
  <AppSupport>http://localhost:14319/WCService.svc?wsdl</AppSupport>
  <AppURL>http://localhost:14319/WCService.svc</AppURL>
  <FileID>{CA1C3EB8-1B61-4747-A743-8D5B438B83AC}</FileID>
  <OwnerID>{8C809D2B-69A9-4B43-A9D0-D41C0938368B}</OwnerID>  
  <QBType>QBFS</QBType>
  <Style>Document</Style>
  <UserName>Dalo</UserName>
</QBWCXML>

然后是服务代码:

代码语言:javascript
运行
复制
public string[] authenticate(string strUserName, string strPassword)
    {
        string evLogTxt = "WebMethod: authenticate() has been called by QBWebconnector" + "\r\n\r\n";
        evLogTxt = evLogTxt + "Parameters received:\r\n";
        evLogTxt = evLogTxt + "string strUserName = " + strUserName + "\r\n";
        evLogTxt = evLogTxt + "string strPassword = " + strPassword + "\r\n";
        evLogTxt = evLogTxt + "\r\n";


        string[] authReturn = new string[3];
        // 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";
        evLogTxt = evLogTxt + "Password locally stored = " + pwd + "\r\n";
        if (strUserName.Trim().Equals("Dalo") && 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] = "C:\\Users\\Dalo\\Documents\\company.QBW";                
            authReturn[2] = "10";                
        }
        else
        {
            authReturn[1] = "nvu";
            authReturn[2] = "";                
        }
        // 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.

        evLogTxt = evLogTxt + "\r\n";
        evLogTxt = evLogTxt + "Return values: " + "\r\n";
        evLogTxt = evLogTxt + "string[] authReturn[0] = " + authReturn[0].ToString() + "\r\n";
        evLogTxt = evLogTxt + "string[] authReturn[1] = " + authReturn[1].ToString();
        logEvent(evLogTxt);
        return authReturn;
    }

其他数据:

  1. 使用工具对身份验证服务进行了测试。
  2. 在代码调试中,当身份验证失败时,web连接器既不调用connectionError服务,也不调用closeConnection来终止连接。
  3. 在调试代码时,可以看到身份验证服务的整个代码都在运行,而不会引发任何异常。

这是回应

代码语言:javascript
运行
复制
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Body>
            <authenticateResponse xmlns="http://developer.intuit.com/">
                <authenticateResult xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                    <a:string>bd68a1e2-7780-46ed-bb8a-09b2b25e156f</a:string>
                    <a:string>C:\Users\Dalo\Documents\company.QBW</a:string>
                </authenticateResult>
            </authenticateResponse>
        </s:Body>
    </s:Envelope>
EN

回答 1

Stack Overflow用户

发布于 2017-12-06 17:25:51

在Go中构建web服务时,我遇到了同样的问题,而直觉QBWC文档似乎非常过时和不完整。我发现这个SOAP1.2版本似乎有效。

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="utf-8"?>
        <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
          <soap12:Body>
            <authenticateResponse xmlns="http://developer.intuit.com/">
              <authenticateResult>
                <string>123a</string>
                <string></string>
              </authenticateResult>
            </authenticateResponse>
          </soap12:Body>
        </soap12:Envelope>

在这里发现的是:https://test.developer.intuit.com/QBWC/TroubleshootWebServiceFS/Service.asmx

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

https://stackoverflow.com/questions/45644381

复制
相关文章

相似问题

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