问题
I have a web application using Intuit API V3 written in vb.net. My application has been working flawlessly while using QuickBooks desktop data. I began testing QuickBooks Online data today. The first time I logged in with my QuickBooks Online user it retrieved the customer list. Subsequent tries to retrieve the customer list fail.
The error message I receive is: "Fault Exception of type: SystemFault has been generated." Inner Exception: System.Collections.Generic.ICollection(Of Intuit.Ipp.Exception.IdsError)
Dim customerList As System.Collections.ObjectModel.ReadOnlyCollection(Of Customer)
'* create service
Dim service As DataService = ValidateService(aPage)
'* create a customer object
Dim customerObject As Customer = New Customer()
If aBool = True Then
customerObject.CompanyName = ""
'* get the customers
customerList = service.FindAll(customerObject, 1, 500)
Else
It fails on the line "customerList = service.FindAll(customerObject, 1, 500)"
Any help on this matter would be greatly appreciated, thank you.
回答1:
Dim oauthValidator As New OAuthRequestValidator(oCommon.AccessToken,oCommon.AccessTokenSecret, oCommon.ConsumerKey, oCommon.ConsumerSecret)
context = New ServiceContext(oCommon.RealmId, oCommon.IPPDataSourceType, oauthValidator)
commonService = New DataService(context)
Dim qbCustomer As New Customer
Dim qbCustomers As New List(Of Customer)
qbCustomers = commonService.FindAll(qbCustomer).ToList
See if the above code works
回答2:
Through trial and error and stepping through my project for a couple days I figured out that my application was not storing the appToken properly so it kept coming back as an empty string. When the service was called it didn't have the correct credentials to successfully make the call. I was able to fix the issue with the appToken storage and the application is working as expected.
来源:https://stackoverflow.com/questions/20355303/intuit-ipp-exception-idserror-while-retrieving-customers