intuit / QuickBooks-V3-Java-SDK

Java SDK for QuickBooks REST API v3 services
Apache License 2.0
70 stars 142 forks source link

Issue when creating TaxService #127

Closed cjgratacos closed 4 years ago

cjgratacos commented 4 years ago

Situation: Currently we have some customers that are using the old style of taxes for QBO. Because of this, we have to use the TaxServices for creating and syncing TaxCodes.

Issue: When creating a TaxService using the QBO sdk, an exception is thrown during the JSON Deserializer interceptor. This is because of a type mismatch. When the type checker check if the type is TaxService, it is actually a type JAXBElement that wraps a TaxService, so the checker fails and deserializes the response object into a TaxCode instead of a TaxService and an exception is thrown. https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/98802b1c872e3cb4e17afd6ff3756d2b6263279e/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/DeserializeInterceptor.java#L71-L81

In short, the TaxCode gets created by the TaxService, but the request response deserialization is throwing an exception because of incorrect type and causing the request to fail.

Replicate:

Info:

Possible solution:

diana-derose commented 4 years ago

Hi @cjgratacos - We'll take a look at this and update it. Please feel free to send a PR.

shweta-intuitdev commented 4 years ago

@cjgratacos - Can you send some code snippets of how you're creating the tax service, along with a sample JSON of the response you're receiving?

diana-derose commented 4 years ago

Closing this @cjgratacos please share more info and reopen if this is still happening.