This appears to be a new issue as we've been Reading closed invoices for years and never encountered this problem.
Reading or querying an invoice that is past the closing date causes the following error: Exception:
"Exception appears in converting Response to XML. in QuickBooksOnline\API\DataService\DataService->Query() (line 1035 of .../libraries/qbo/src/DataService/DataService.php)"
Comparing the two xml responses:
Working non-closed Invoice xml:
"<QueryResponse startPosition="1" maxResults="1" totalCount="1"><Invoice sparse="true"><Id>xxxx</Id><BillAddr><Id>yyyy</Id></BillAddr></Invoice></QueryResponse>"
This appears to be a new issue as we've been Reading closed invoices for years and never encountered this problem.
Reading or querying an invoice that is past the closing date causes the following error: Exception: "Exception appears in converting Response to XML. in QuickBooksOnline\API\DataService\DataService->Query() (line 1035 of .../libraries/qbo/src/DataService/DataService.php)"
Comparing the two xml responses: Working non-closed Invoice xml:
"<QueryResponse startPosition="1" maxResults="1" totalCount="1"><Invoice sparse="true"><Id>xxxx</Id><BillAddr><Id>yyyy</Id></BillAddr></Invoice></QueryResponse>"
Non-working closed Invoice xml:
"<QueryResponse startPosition="1" maxResults="1" totalCount="1"><Invoice sparse="true"><Id>xxxx</Id><BillAddr><Id>yyyy</Id></BillAddr><GratuityEnabled>false</GratuityEnabled></Invoice></QueryResponse>"
Appears the primary difference is the inclusion of
"<GratuityEnabled>false</GratuityEnabled>"
in the second response.Removing the Gratuity property resolves the issue for us (private app for internal use only. we never utilize gratuity in invoices).
$tmpXML = str_replace('<GratuityEnabled>false</GratuityEnabled>', '', $tmpXML);
I suspect responseSerializer->Deserialize is failing to parse
<GratuityEnabled>