【问题标题】:CustomerQuery ResponseStream was null or emptyCustomerQuery ResponseStream 为空或为空
【发布时间】:2013-11-04 22:43:47
【问题描述】:

我通过客户名称调用 CustomerQuery 以获取 ID。我的代码已经工作了很长一段时间,没有任何变化。现在,它返回 IdsException 'ResponseStream was null or empty。这是我的代码:

Dim CustomerQuery as new Intuit.Ipp.Data.Qbo.CustomerQuery
CustomerQuery.Name = CustomerName
Dim qboCustomers as IEnumerable(Of Intuit.Ipp.Data.Qbo.Customer) = CustomerQuery.ExecuteQuery(of Intuit.Ipp.Data.Qbo.Customer)(context)
If qboCustomers.Count>0 then
    Return qboCustomers(0).Id.Value
Else
    Return ""
End If

我相信即使没有匹配,查询也不应该为空或空。我认为计数应该只是 0。或者,至少我相信它在过去是这样工作的。我错了吗?

【问题讨论】:

  • 您可以尝试使用 fiddler 等工具捕获原始请求 XML,并在 ApiExplorer 中使用相同的工具,看看它是否正常工作。
  • 我尝试使用数据来代替。它最初搜索的 CustomerName 是“N22222 90996-1 SARABANDA AVIATION”。从客户名称中删除 90996-1 后,它给了我 0 个客户的预期响应,而不是 ID 异常。之前的客户名称有什么问题导致它抛出错误?它不喜欢客户名称中的连字符吗?

标签: vb.net intuit-partner-platform quickbooks-online


【解决方案1】:

查询中的特殊字符会导致异常。你需要先处理它们。 请参阅此解决方案以在 V3 服务中查询时转义特殊字符- https://gist.github.com/IntuitDeveloperRelations/6582149

【讨论】:

  • 您的示例显示了转义引号。数据中没有报价。连字符是否被视为需要转义的特殊字符?
猜你喜欢
  • 2014-05-23
  • 1970-01-01
  • 2014-07-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-30
  • 1970-01-01
相关资源
最近更新 更多