我正在使用 QuickBooks WebConnector 2.2.0.71 和我的 WCF Web 服务(在 .NET 4.6.1 上)。在 WebConnector 中按“选择更新”serverVersion
并clientVersion
成功处理请求后,但authenticate
失败:
20170705.06:31:00 UTC : QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="username"><password=<MaskedForSecurity>
20170705.06:31:00 UTC : QBWebConnector.SOAPWebService.do_authenticate() : QBWC1012: Authentication failed due to following error message.
Index Out Of Range.
More info:
StackTrace = в QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName)
Source = QBWebConnector
我的 WCF 服务的响应(来自 WCF 测试客户端):
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<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>a3f10876-e027-419d-8dd8-3752a852ddae</a:string>
<a:string>nvu</a:string>
<a:string>3</a:string>
<a:string>60</a:string>
<a:string>60</a:string>
</authenticateResult>
</authenticateResponse>
</s:Body>
</s:Envelope>
Docs 说“您的回调必须返回一个包含 4 个可能元素的字符串数组。第一个元素包含 NONE 或 NVU(无效用户)或 BUSY。或空字符串,或作为 QB 公司文件名的字符串。” 但在示例中,第一个元素是 guid 令牌,所以我发送了 5 个元素的数组。
当我发送的不是数组而是 int 值时发生了同样的错误,所以我猜 - 也许我的 xml 有问题?