Invalid XML character found when fetching customer list

时间:2016-04-04 18:59:13

标签: quickbooks-online

Users are able to copy/paste invalid characters into Notes fields when using QBO. When using QBO SDK v3 service to load customer list from QBO exception is thrown when API is trying to deserialize XML. We have no control over the text QBO clients paste into their customer notes online. We have no control over the XML that Intuit v3 service sends to the QBO SDK assemblies where the error occurs. Intuit has indicated they will not be filtering invalid characters from the XML they send to their SDK assemblies. (See comments at https://intuitdeveloper.lc.intuit.com/questions/903965-invalid-xml-character-found-when-fetching-customer-list)

We are currently getting 500 customers at a time. The best plan I can think of is:

  1. Trap that specific error.
  2. Request the same batch of 500 one at a time while intercepting the XML log for each.
  3. Notify the user of the one(s) with that error and either skip it OR modify the online notes using the intercepted and cleaned XML notes and request it again.
  4. Then resume with the next 500 after those are finished.

This is a lot of work to compensate for an Intuit system issue. Is there any easier ways to either compensate for or prevent this issue? May the force be with you.

1 个答案:

答案 0 :(得分:0)

咳咳。在.Net API中真的非常简单。不要使用XML。

ServiceContext.IppConfiguration.Message.Request.SerializationFormat = Intuit.Ipp.Core.Configuration.SerializationFormat.Json
ServiceContext.IppConfiguration.Message.Response.SerializationFormat = Intuit.Ipp.Core.Configuration.SerializationFormat.Json