> Experience from the past: You need to start with simple examples and get a
> feeling for how it works.
Agreed. I am trying to go step-by-step, but the documentation is using
examples
in other languages and different circumstances. I feel a bit like I am
fumbling around
in the dark.
Reading the docs from Intuit, I think I would like to use their XML
interface
instead of the foundation classes since it seems the XML is more functional.
Therefore, I am trying to follow their VB example and write it in Java.
Looking at the two variants you linked me to, Variant 2 seems very
complicated
so I tried looking at Variant 1 which seems approachable.
Using that and some stuff I found on the Internet, I came up with the
attached sample class file.
I have QuickBooks open on the company file I am trying to access.
It seems to be working to a point. QuickBooks prompts me to allow or deny
access to the application. When I allow it, I get this error:
Exception in thread "main"
com.sun.jna.platform.win32.COM.COMInvokeException: Exception
occurred.(HRESULT: 80020009)
Source: QBXMLRP2.RequestProcessor.2
Description: The ticket parameter is invalid.
at com.sun.jna.platform.win32.COM.COMUtils.checkRC(COMUtils.java:187)
at
com.sun.jna.platform.win32.COM.COMBindingBaseObject.oleMethod(COMBindingBaseObject.java:261)
at
com.sun.jna.platform.win32.COM.COMBindingBaseObject.oleMethod(COMBindingBaseObject.java:188)
at
com.sun.jna.platform.win32.COM.COMLateBindingObject.invoke(COMLateBindingObject.java:281)
at
com.sun.jna.platform.win32.COM.COMLateBindingObject.invoke(COMLateBindingObject.java:298)
at com.propfinancing.qb.JNATest.run(JNATest.java:28)
at com.propfinancing.qb.JNATest.main(JNATest.java:33)
It is not complaining about my simple XML, it is complaining about the
ticket which I should have
received back from the BeginSession call. I am not sure what I am supposed
to do about that.