cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello,

I followed this blog post to access an OData service with the Cloud Platform SDK. I Used a custom OData Service instead of the standard Businesspartner OData service and a R3 ERP on-Premise backend system instead of S/4 HANA.

If I deploy the app to my Cloud Foundry subaccount it is working fine and my OData service is executed via Cloud Connector and destination service on my on-premise backend.

If I try to execute the same application on the local tomee server the on-premise backend system is not reached.

My destination on my subaccount looks like this:

If I pass all the information (URL,User,Password) to the local destination it is not working...

The same erroppr apperas on executing the integration tests.

What must I do to access my on-premise backlend from localhost?

Best regards,

Chris

View Entire Topic
christoffer_fuss
Participant
0 Likes

Hi Marco,

here ist the Servlet:

@WebServlet("/tiles")
public class TPServlet extends HttpServlet{
    
         private static final long serialVersionUID = 1L;
        private static final Logger logger = LoggerFactory.getLogger(TPServlet.class);

        private final ErpHttpDestination destination = DestinationAccessor.getDestination("saperp").asHttp().decorate(DefaultErpHttpDestination::new);

        @Override
        protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
                throws ServletException, IOException {
            try {
                final List<Tile> tiles =
                        new DefaultTpsrvService()
                                .getAllTile()
                                .orderBy(Tile.SORT, Order.ASC)
                                .top(200)
                                .execute(destination);

                response.setContentType("application/json");
                response.getWriter().write(new Gson().toJson(tiles));
            } catch (final ODataException e) {
                logger.error(e.getMessage(), e);
                response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
                response.getWriter().write(e.getMessage());
            }

        }

}

Best Regards and thnaks for helping,

Chris