Я пытаюсь вызвать BAPI с контроллера Spring REST.
Вызов бэкэнд-системы работает нормально, однако возврат 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);
}
Есть идеи, почему появляется эта ошибка?