我在一個java web項目中使用QuickBooks Javav3SDK2.0.3並試圖獲取下面給出的客戶列表,但是我得到了下面的異常。 API在傳遞HttpServletRequest的同時期望com.intuit.apache.http.HttpRequest類型的請求。QuickBooks API拋出異常com.intuit.apache.http.HttpRequest
代碼:
OAuthAuthorizer oauth = new OAuthAuthorizer(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
Context context = new Context(oauth, APP_TOKEN, ServiceType.QBO, COMPANY_ID);
DataService service = new DataService(context);
Customer customer = new Customer();
List<Customer> customers = service.findAll(customer);
Iterator itr = customers.iterator();
while (itr.hasNext())
{
Customer customer2 = (Customer) itr.next();
String customerName = customer2.getFullyQualifiedName();
System.out.println(customerName);
}
例外:
java.lang.IllegalArgumentException異常:該消費者期望類型com.intuit.apache.http.HttpRequest
感謝您的時間Navey。其實我有一個非常簡單的java web項目,它只包含Javav3SDK2.0.3罐子。所以所有的類都使用相同的SDK。 –