cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Business Application Studio

renuka23
Explorer
0 Kudos

I am working on BTP-Mobile service where we are building the front-end application in the Business Application studio using MDK(Mobile Development Kit) template. To test the application in BAS, we are deploying it by using Application.app-> MDK:Deploy -> Your Dev Space. After that in 'Run Configuration' we are executing the module by clicking on 'Run Module'. Then WebApplicationFactory starts running and a pop-up opens on the right bottom 'A service is listening to port 6004'. When I clicked on that it is opening a new tab and executing the application but there I am getting error on the page Failed to initialize application data service - Error: 502 (); GET /nstest22/Raj_PODEtails_Destination/ Bad Gateway. (Ref Screenshot 1)

I have already tested the OData service in Connectivity feature of Mobile Service where I am able to see the data of all entity sets. I am not able to test the application in BAS. (Ref Screenshot 2

)

How to resolve this issue or is there any other way to preview/execute the application in BAS?

View Entire Topic
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

I can see that Token Service URL is not correct, it should also contain /oauth/token at the end. e.g., https://1ad...hana.ondemand.com/oauth/token

I can't see the full path of the URL property but i assume it's pointing to Destination API from mobile services.

Questions - why are you configuring your BTP destination via mobile services proxy? Using what framework your OData service has been produced? e.g. SAP Gateway/CAP/mobile backend tools/others?

renuka23
Explorer
0 Kudos

Thank you for the answer.

Issue has been resolved by adding /oauth/token at the end of Token Service URL. Full path of URL was already pointing to the Destination API from Mobile Service.

OData service has been created using SAP Gateway. I am following this Set Up Initial Configuration for an MDK App | Tutorials for SAP Developers tutorial. That's why I have configured BTP destination via Mobile Service Proxy.

Is there any other way to do all these steps?

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

OData service has been created using SAP Gateway. I am following this Set Up Initial Configuration for an MDK App | Tutorials for SAP Developers tutorial. That's why I have configured BTP destination via Mobile Service Proxy. >> As the sample service is available in the mobile services , the only way to access it via mobile service proxy. Hence those additional steps are required.

Is there any other way to do all these steps? >> You can configure your BTP destination with the similar configuration as you have configure the mobile destination. (provide the same URL, authentication type etc.)

renuka23
Explorer
0 Kudos

Okay. So now I have created the destination in BTP Cockpit with similar configuration as Mobile Destination. Then, while creating the application in BAS first we have to select the template as MDK and then we have to do the service configuration. Till now I have been adding the destination in Mobile Service Connectivity and then selecting the same in BAS while creating the project(i.e. Data Source as Mobile Services and then selected the application ID and destination).(ref Screenshot 1)

Even if we select the BTP Destination in the BAS, then how it will connect with the Native/Hybrid application created in the Mobile Service? and how to create the build job for that BAS application.

Till now when I have selected the Service Configuration as mobile service and deployed the application, in 'Mobile Cloud Build' feature the build was getting created successfully for the last deployed application in BAS related to that Mobile Service.

How it will work in this case? Please suggest reference blog if you have any.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

renuka23

Do you want to run your (same) app in both mobile clients and in web browser?

renuka23
Explorer
0 Kudos

I want the application to run on Mobile apps only as this is the requirement of client that they have the OData service ready and want to see the details on Mobile app.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Then you don't need to select/create any BTP destination. BTP destination is used for MDK web application.

renuka23
Explorer
0 Kudos

Okay. But if BTP destination is not there then I am not able to test the application locally. It does not work even if I select MDK Deploy: Your Dev Space. It started working after creation of Destination in the BTP cockpit with the details suggested by you.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

That Deploy to your Dev Space option is mainly for web application only to test them before deploying to BTP. I don't suggest you to use this option if the goal is to run the app in mobile client. There are still some limitations in web runtime compared to mobile clients.

If you want to run your app locally in mobile clients, you need to create your branded client using MDK SDK, install the MDK extension in Visual studio code, open your metadata project in VSC, execute build process. See documentation. You can set up e.g. git to sync the code changes between BAS and VSC.

renuka23
Explorer
0 Kudos

Thank you for the explanation.

renuka23
Explorer
0 Kudos

Hi jitendrakumar.kansal . Can you please help me to resolve this issue ->

UI created using BAS-MDK Not Getting Rendered on Mobile App | SAP Community