我正在尝试通过使用Quickbooks在线SDK删除项目。但是,当我调用DataService Delete方法时,它只是给我一个代码500错误。有人遇到过这个问题并解决过吗?
我正在使用JSON格式进行序列化。
CODE = >>>
public IEntity executeDeleteItem(Item i){
IEntity results = null;
String realmId = (String)session.getAttribute("realmId");
if (StringUtils.isEmpty(realmId)) {
System.out.println("ReaLm id is null ");
}
String accessToken = (String)session.getAttribute("access_token");
try {
//get DataService
DataService service = serviceHelper.getDataService(realmId, accessToken);
/**
* EXECUTE CREATE AND DELETE COMMANDS ACCORDINGLY
* RESAERYCH API
*/
//QueryResult queryResult = service.executeQuery(sql);
//return queryResult.getEntities();
try{
service.deleteAsync(i, new AsyncCallBack());
} catch(FMSException e){
System.out.println("Error while calling executeQuery :: " + e.getMessage());
}
}
/*
* Handle 401 status code -
* If a 401 response is received, refresh tokens should be used to get a new access token,
* and the API call should be tried again.
*/
catch (InvalidTokenException e) {
System.out.println("Error while calling executeQuery :: " + e.getMessage());
//call company info again using new tokens
System.out.println("calling companyinfo using new tokens");
refreshQBOSession();
/**
* EXECUTE METHOD ONCE AGAIN AFTER TOKEN HAS BEEN REFEESHED
*/
results = executeAddItem(i);
} catch (FMSException e) {
List<Error> list = e.getErrorList();
list.forEach(error -> System.out.println("Error while calling executeQuery :: " + error.getMessage()));
}
return results;
}
错误= >>
com.intuit.ipp.exception.FMSException:错误代码:500,错误消息:不支持的操作,错误详细信息:操作不支持删除。,更多错误详细信息:操作 在com.intuit.ipp.interceptors.HandleResponseInterceptor.execute(HandleResponseInterceptor.java:120)〜[ipp-v3-java-devkit-4.0.3-jar-with-dependencies.jar:na] 在com.intuit.ipp.interceptors.IntuitInterceptorProvider.executeResponseInterceptors(IntuitInterceptorProvider.java:114)〜[ipp-v3-java-devkit-4.0.3-jar-with-dependencies.jar:na] 在com.intuit.ipp.interceptors.IntuitInterceptorProvider.executeInterceptors(IntuitInterceptorProvider.java:87)〜[ipp-v3-java-devkit-4.0.3-jar-with-dependencies.jar:na] 在com.intuit.ipp.interceptors.IntuitInterceptorProvider.call(IntuitInterceptorProvider.java:150)〜[ipp-v3-java-devkit-4.0.3-jar-with-dependencies.jar:na] 在com.intuit.ipp.interceptors.IntuitInterceptorProvider.call(IntuitInterceptorProvider.java:36)〜[ipp-v3-java-devkit-4.0.3-jar-with-dependencies.jar:na] 在java.base / java.util.concurrent.FutureTask.run(FutureTask.java:264)〜[na:na] 在java.base / java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)〜[na:na] 在java.base / java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:628)〜[na:na] 在java.base / java.lang.Thread.run(Thread.java:834)〜[na:na]