cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect and test CAP application locally with destinations using hybrid profile?

kaizen9
Explorer
0 Kudos
240

Hello supporters,
I do not want to deploy and test application, as developer, I would like to test app locally before push.
Running hybrid profile worked but returned empty array.

Why it shows empty array to me? What did I miss?

I am using Business Application Studio - BAS

It works in Postman.

kaizen9_0-1743431315957.png

cds watch --profile hybrid
cds serve all --with-mocks --in-memory? --profile hybrid 
live reload enabled for browsers
resolving cloud service bindings...
bound destinations to Cloud Foundry managed service opps-mta-destination:opps--destination-key
bound auth to Cloud Foundry managed service opps-mta-xsuaa:opps-mta-xsuaa-key
----
[cds] - mocking OPPS_DataAccessV4 { path: '/odata/v4/opps-data-access-v4' }
[cds] - server listening on { url: 'http://localhost:4004' }
----

 

Update: 
Is there anything wrong in my Run Configuration?

Why I don't see Live Data option also?  based on Run Config documentation.

Step 1 try: 

kaizen9_2-1743519999905.png

I turned the option to -> "Mock external OData services (Off)"

[cds] - connect to db > sqlite {url: ':memory:'}
/> successfully deployed to in-memory database. 
Process exited with code 1
Error: No credentials configured for "OPPS_DataAccessV4".
    at RemoteService.init (/home/user/projects/opps-promotions-api-mta/node_modules/@sap/cds/libx/_runtime/remote/Service.js:223:13)

When clicked on 3rd option "OPPS_DataAccessV4 - OData" in order to Bind it, then got strange error:

kaizen9_0-1743519695437.png

Step 2 try:

kaizen9_0-1743543853155.png

I turned the option to ->  "Mock external OData services (On)" and I got error:

Process exited with code 1
[cds] - using auth strategy {kind: 'xsuaa', impl: 'node_modules/@sap/cds/lib/auth/jwt-auth'} 
Error: Authentication kind "xsuaa" configured, but no XSUAA instance bound to application. Either bind an XSUAA instance, or switch to an authentication kind that does not require a binding.

How to fix this?

We really need to solve this. Please support, Thanks.

@vvdries @gregorw @qmacro @martinfrick @martinstenzig @WouterLemaire @Marian_Zeis 
@showkath_naseem @LucasBorin @massimiliano_cardosi @rotem_puterman-sobe @MariamIdman

I referred these posts: 

https://community.sap.com/t5/technology-blogs-by-sap/btp-cap-how-to-connect-to-remote-services-local...

https://community.sap.com/t5/technology-blogs-by-members/sap-cap-hybrid-testing/ba-p/13556582

https://community.sap.com/t5/technology-q-a/btp-cap-connect-to-remote-service-locally-hybrid/qaq-p/1...

 

View Entire Topic
rotem_puterman-sobe
Product and Topic Expert
Product and Topic Expert

Hi,
Are you developing in SAP Business Application Studio? If so, you can use the "Run Configuration" tool for this purpose, available from the "Full-Stack Application using Productivity Tools" dev space.

See more information here: https://help.sap.com/docs/bas/developing-business-applications-using-productivity-tools/testing-appl...

Thanks,

Rotem

kaizen9
Explorer
0 Kudos

Thank you for response @rotem_puterman-sobe
Yes, I am using Business Application Studio.
Please see the updated question and why Run Config failed.

Can you help here please? Thanks.