我正在尝试从Spring控制器调用BAPI。对后端系统的调用工作正常,但是返回ResponseEntity会导致一个错误,"**getOutputStream()** 已经为这个响应“”调用了
@RequestMapping( method = RequestMethod.GET )
public ResponseEntity<List<ExportingCostCenterInformation>> getBusinessPartners()
{
final ErpEndpoint endpoint = new ErpEndpoint(new ErpConfigContext("ErpQueryEndpoint_RFC"));
final BapiQuery query = new BapiQuery("BAPI_COSTCENTER_GETLIST")
.withExporting("CONTROLLINGAREA", "KOKRS", "1000");
List<ExportingCostCenterInformation> ecci = null;
try {
ecci = query.execute(endpoint)
.get("COSTCENTER_LIST")
.getAsCollection()
.asList(ExportingCostCenterInformation.class);
} catch (UnsupportedOperationException | IllegalArgumentException | QuerySerializationException | DestinationNotFoundException | DestinationAccessException | QueryExecutionException e) {
// ...
}
return ResponseEntity.ok(ecci);
}知道为什么会出现这个错误吗?
发布于 2018-05-16 10:16:31
ExportingCostCenterInformation类的getter & setter方法没有得到很好的定义。这就是问题所在。
https://stackoverflow.com/questions/50345750
复制相似问题