Skip to content
Advertisement

Quickbooks Web Connector “Response is not well-formed XML” error

We are using the Quickbooks Web Connector (QBWC) with the Consolibyte Quickbooks PHP Dev Kit. We have had a QBWC job working with this software for 4 years without major issues; however, now we are adding an additional QBWC job to access a different QB company file and a different handler. Every time this job runs it gets an error “Response is not well-formed XML”:

JavaScript

The error starts on serverVersion() but the job doesn’t actually fail until authenticate(). It seems that the problem is in the PHP handler; however, it is not logging any errors, and the dev kit log table shows proper XML:

JavaScript

What I don’t understand is that the PHP handler’s XML response to serverVersion() looks fine (in fact identical to the XML returned by the working handler except for the URL), and this handler is logging no errors, but QBWC is rejecting it.

Advertisement

Answer

SOLVED – The XML response to QBWC had a single extra line feed before the XML declaration, which was causing QBWC to completely reject it. The source of the extra character was a PHP config file that had a blank line before the first <?php tag. Doh!

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement