Error with parsing Payroll with QBWC

140 views Asked by At

Maybe someone can help me here, I want to get all payroll details from Quickbooks using QBWC but I'm getting 0x80040400 error saying QuickBooks found an error when parsing the provided XML text stream.

When I do other queries it works perfect only for this query I'm getting this error.

Here is the XML I'm sending to QB:

<?qbxml version="7.0"?>
<QBXML>
  <QBXMLMsgsRq onError="stopOnError">
    <PayrollDetailReportQueryRq>
      <PayrollDetailReportType>PayrollTransactionDetail</PayrollDetailReportType>
      <DisplayReport>true</DisplayReport>
      <ReportDateMacro>All</ReportDateMacro>
      <ReportClassFilter>                
        <FullName>Name</FullName>
      </ReportClassFilter>
      <ReportModifiedDateRangeMacro>All</ReportModifiedDateRangeMacro>
      <ReportDetailLevelFilter>All</ReportDetailLevelFilter> <!-- opt, v3.0 -->
    </PayrollDetailReportQueryRq>
  </QBXMLEvents>
</QBXML>
2

There are 2 answers

1
Keith Palmer Jr. On

Did you try the XML Validator and see what it said?

Line: 14
LinePos: 5
Src Text: </QBXMLEvents>
Reason: End tag 'QBXMLEvents' does not match the start tag 'QBXMLMsgsRq'.

Your document isn't valid XML. Fix the ending tag <QBXMLEvents> to match the starting tag QBXMLMsgsRq.

0
Hpjchobbes On

You'll want to include the xml version information, even though the validation tool validates the file without it. Here's the code that I used to generate the report:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="7.0"?>
<QBXML>
    <QBXMLMsgsRq onError = "stopOnError">
        <PayrollDetailReportQueryRq>
            <PayrollDetailReportType>PayrollTransactionDetail</PayrollDetailReportType>
            <DisplayReport>true</DisplayReport>
            <ReportDateMacro>All</ReportDateMacro>
            <ReportClassFilter>
                <FullName>Name</FullName>
            </ReportClassFilter>
            <ReportModifiedDateRangeMacro>All</ReportModifiedDateRangeMacro>
            <ReportDetailLevelFilter>All</ReportDetailLevelFilter>
        </PayrollDetailReportQueryRq>
    </QBXMLMsgsRq>
</QBXML>