4

Using the Quickbooks SDK QBFC 7.0. When I attempt to get a list of all customers in quickbooks, if any of the customers have an accented character in their name like è then I get an exception:

An Exception occurred! Type:UTFDataFormatException, Message: invalid byte 2 (<) 
of a 3-byte sequence. SAXParseException: error ar line 1, column 23 in XML data.

Several Intuit forums have said that I have to change the XML to UTF-8 (which is all they say, they give no real solution), the QBFC clearly does use XML for sending and receiving data, but I can't find anyway to override the default encoding.

The request is created with the following code. The exception occurs on DoRequests()

IMsgSetRequest req = Session.GetLatestMsgSetRequest();
ICustomerQuery cq = req.AppendCustomerQueryRq();
IMsgSetResponse responseSet = Session.QBSM.DoRequests(req);
Jack B Nimble
  • 5,039
  • 4
  • 40
  • 62

3 Answers3

6

QBFC has a bug where it will not encode properly. There is not a way to override the encoding with QBFC. The solutions you have are to either use qbXML, or if you use the IncludeRetElementList option when creating your query, it should encode properly. Keep in mind that if you use IncludeRetElementList you have to specify the exact fields that you want returned.

ICustomerQuery custQuery = MsgRequest.AppendCustomerQueryRq();
custQuery.IncludeRetElementList.Add("ListID");
custQuery.IncludeRetElementList.Add("Name");
custQuery.IncludeRetElementList.Add("FirstName");
custQuery.IncludeRetElementList.Add("LastName");
custQuery.IncludeRetElementList.Add("ShipAddress");
Hpjchobbes
  • 1,309
  • 1
  • 8
  • 11
0

I don't know of a solution in the QBFC, but as a workaround you could go directly to qbXML, and send and receive the response for this particular message using XML. It sounds like you have a limitation in the QBFC, which is really a wrapper for the underlying XML.

Yishai
  • 90,445
  • 31
  • 189
  • 263
0

The overflow appear when I tried to view trial balance report, some accounts display with overflow as it does not show any numbers.

What you think is a problem.

Thanks

Richard