| Home | Templates | Classes | Guides |
The wrapper includes a tool for debugging and inspection: QBTools.ShowXMLViewer().
The viewer has two tabs:
QBParser.ValidateResponse() first.Note: The viewer does not display raw, one line QBXML. It always pretty prints for readability. The Response XML tab is only meaningful after validation.
Below the tabbed XML area there is a summary section titled API response after ProcessRequest completed.
When a response has been validated, this section automatically extracts and shows:
This saves you from digging through the XML to find these values.
Two buttons appear under the summary panel. They operate on the currently selected tab.
Open XML in Browser
Opens the selected XML in your default browser. Most browsers render XML with a disclosure tree so you can expand and collapse nodes, scan nested elements, and inspect individual records easily.
Copy XML to Clipboard
Copies the selected XML to the clipboard. This is useful for pasting into your notes, saving test artifacts, or sending XML to support.
QuickBooks returns one long string without line breaks. QBParser.ValidateResponse() finds the correct <...Rs> block in that string and prepares it for display. Without validation, there is no specific response block to format, so the Response XML tab and the response summary values will not be populated.
Call the viewer after a successful request, then validate so the Response XML tab and summary panel are populated.
! Build the XML request
QBWriter.Init('CustomerQuery')
QBWriter.RequestAddTag('IncludeRetElement', 'Name')
QBWriter.RequestAddTag('IncludeRetElement', 'ListID')
QBWriter.RequestClose()
! Send the request and get the response
ResultCode = QBSessionMgr.ProcessRequest()
IF ResultCode <> 0
MESSAGE('Request failed. Code: ' & ResultCode, 'Error', ICON:Exclamation)
RETURN
END
! Initialize the parser and validate the response block
QBParser.Init('CustomerQuery', QBSessionMgr)
IF QBParser.ValidateResponse()
QBTools.ShowXMLViewer() ! Request XML, formatted Response XML, and summary panel will be available
ELSE
MESSAGE('Response block not found or failed validation.', 'Error', ICON:Exclamation)
END
If you only want to review the request you built, you can open the viewer at any time after forming the request. The Response XML tab and summary panel will not be populated until validation succeeds.
QBTools.ShowXMLViewer()
| Home | Templates | Classes | Guides |