Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Service Mock - Working fine with local mock server when testing locally but not working after deploying to BTP #103

Closed
sammok83 opened this issue Feb 20, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@sammok83
Copy link

I've done all all the steps and pre-requisites of
https://github.com/SAP-samples/btp-developer-guide-cap/blob/main/documentation/remote-service/remote-service-mock-cf.md

Tested Locally with the mock server and everything is working fine.
However after deploying it to CF on BTP, the connection to the external service (mock server) did not work. This when querying the Customer dropdown:
image

Error as below:
**--batch_id-1708430817172-490
content-type: application/http
content-transfer-encoding: binary

HTTP/1.1 502 undefined
odata-version: 4.0
content-type: application/json;odata.metadata=minimal;IEEE754Compatible=true

{"error":{"code":"502","message":"Error during request to remote service: \nRequest failed with status code 404"}}
--batch_id-1708430817172-490--**

Mock Server destination define and working fine:
image

Querying is working fine too with the URL defined in the destination:
image

Credentials defined in package.json:
image

@navinkrishnan
Copy link

Hi @sammok83
Please change the path in credential configuration in package.json.

"API_BUSINESS_PARTNER": {
                "kind": "odata-v2",
                "model": "srv/external/API_BUSINESS_PARTNER",
                "[production]": {
                    "credentials": {
                        "destination": "incidents-api-access",
                        "path": "/odata/v2/api-business-partner"
                    }
                }
            }

We have recently migrated the mock server to cap-js-community/odata-v2-adapter which requires this new path.
Documents will be updated soon.

@navinkrishnan navinkrishnan added the documentation Improvements or additions to documentation label Feb 20, 2024
@sammok83
Copy link
Author

Thanks works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants