cancel
Showing results for 
Search instead for 
Did you mean: 

Connect Node.js app on Cloud Foundry to S/4HANA Cloud as an Outbound system

Hello everyone.

Our team is trying to connect our Node.js service to S/4HANA Cloud so that the Node service receives SOAP requests. The specific communication scenario is SAP_COM_0444 which the inbound service is for creating/ updating Sales Scheduling Agreements and the outbound service is for sending out Outbound Delivery notifications. We could successfully use the inbound service, but we are not having much luck with the outbound service.

This is what we have done so far. We made a custom endpoint that accepts SOAP envelopes, so we don't believe it is a problem with our application. We deployed our application to my SAP Cloud Platform Trial account, and we routed to it with a Communication Arrangement. This is what we put down:

  • Service Status: Active (Checked)
  • Application Protocol: SOAP
  • Port: 8080 (I'm not exactly sure if this correct, but I know this is the port that my service is running on).
  • Path: /api/outbound/test (this is the API path for the Node server)
  • Service URL: https://[apphost].com:8080/api/outbound/test (this is automatically generated from the Communication System, the port, and the path)

After doing some debugging locally, I discovered that putting down port 8080 was not correct. The problem is that we cannot use just a normal url without the port since that the S/4HANA Cloud App for setting communication arrangements automatically replaces the blank input with 0. The only way I can think of in order to make the connection work is to open up the port somewhere in the Cloud Foundry service link.

So my question is, when deploying to SAP Cloud Platform for the Cloud Foundry environment, how might we set the port for the service link? Instead of port 8080, we could set it to 443 or some other port instead. This is my first guess, but there could be other solutions as well.

Thank you very much!

Accepted Solutions (1)

Accepted Solutions (1)

geert-janklaps
Active Contributor

Hi,

I think what you're missing is the port configured by the CF environment. You can't determine the internal port (at least for as far as I know) of the running app. You can use following example for an express app:

app.set('port', process.env.PORT || 8080);

When deployed to the CF environment internally a port will be determined, but in the end it will be accessible using 443. So you'll need to configure your communication arrangement with 443 instead of 8080. (the || 8080 in the example will make sure that when you're running in a local environment the app will run on port 8080)

Best regards,

Geert-Jan Klaps

Thank you for the answer Geert-Jan,

I had the first part inside of my Node application already, but setting the port in the communication arrangement did the trick! My next part though is setting up the output control for the outbound delivery service, but that is in a different domain from the networking portion.

Best regards,

Kyle

Answers (0)