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,

summary: the local host is connected by using the real host name instead of Cloud Connector.
Enviroment variable looks like this:

set destinations=[{name: "saperp", url: "http://dt1.datatrain-....de:8000", username: "user", password: "password"}]

If I use the same url in my systems.yml, the integraion test is failing because the connection is revoked. The systems.yml looks like this:

---
erp:
  default: "saperp"
  systems:
    - alias: "saperp"
      uri: "http://dt1.datatrain-....de:8000"
      systemId: "DT1"           # optional, defaults to ""
      sapClient: "100"                 # optional, defaults to default SAP cl
      locale: "de"                     # optional, defaults to English (US)
      erpEdition: "on-premise"         # optional, defaults to "cloud"

credentials.yml looks like this:

---
credentials:
- alias: "saperp"
  username: "user"
  password: "password"

The integration test looks like this:

 @BeforeClass
    public static void beforeClass() {
        mockUtil.mockDefaults();
        mockUtil.mockErpDestination("saperp", "saperp");
    }

    @Before
    public void before() {
        //RestAssured.baseURI = baseUrl.toExternalForm();
    }

    @Test
    public void testService() {
        // JSON schema validation from resource definition
        final JsonSchemaValidator jsonValidator = JsonSchemaValidator
                .matchesJsonSchemaInClasspath("tiles-schema.json");

        // HTTP GET response OK, JSON header and valid schema
        when()
                .get("/tiles")
        .then()
                .statusCode(200)
                .contentType(ContentType.JSON)
                .body(jsonValidator);
    }

Here is a part of the log:

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.98 s <<< FAILURE! - in de.datatrain.TPServletTest
[ERROR] testService(de.datatrain.TPServletTest)  Time elapsed: 5.819 s  <<< ERROR!
java.net.ConnectException: Connection refused: connect
        at de.datatrain.TPServletTest.testService(TPServletTest.java:55)

Any idea what is getting wrong?

Thank you very much for helping.

Best regrads,

Chris