cancel
Showing results for 
Search instead for 
Did you mean: 

MDK Mobile App returning error unknown error

0 Kudos

Hi ,

I am following this tutorial to deploy my first MDK app to Web

https://developers.sap.com/tutorials/cp-mobile-dev-kit-ms-setup.html

https://developers.sap.com/tutorials/cp-mobile-dev-kit-offline-app.html

But After deploying the app, I am getting underlying error

Failed to initialize application data service - Error: Error 0 (Unknown); GET https://webclient/sample_service_v2/

Looks Like it's an cross domain error from network trace ...

Please help me on this.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

subha8707_65

Did you already setup sample_service_v2 destination in BTP cockpit for your web app?

Can you share its configuration?

0 Kudos

@jitendrakumar.kansal

Yes it's already setup in BTP cockpit

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos
subha8707_65

can you share a screenshot of that BTP destination?

0 Kudos

This is the Screen Shoot

0 Kudos

continued

0 Kudos

@jitendrakumar.kansal

Any update on this ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert

Please double check the URL as highlighted in the attached screenshot.
This URL should be the destination API from Mobile Services, check step 4.2 from this tutorial https://developers.sap.com/tutorials/cp-mobile-dev-kit-ms-setup.html
(you should see Connection to "sample_service_v2" established. Response returned: "400: Bad Request when checking the connection)

jitendrakumar.kansal

Ok, I have rectified the url and noew I am getting 400 Bad request

But now after deployment I am getting Failed to load resource: the server responded with a status of 500 (Internal Server Error)

any suggestion on this !

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos
  • Can you try running the web app URL in another browser? or In a private/incognito window?
  • Can you share how the Destination block looks like in your .project.json file?

Meanwhile, just to check the BTP destination is configured correctly, you can try below -

  • in BAS editor, open .service file in the MDK service editor, select source type as BTP destination, select Destination name as sample_service_v2 and click "Sync service" , do you see the metadata being fetched successfully? If so, this ensure that BTP destination configuration are working in the editor.
yavuzasik
Participant
0 Kudos

Hi @jitendrakumar.kansal

I am having a similar issue during the testing of my mobile app with the web interface. App works properly within the Mobile client. All my developments are done with SAP BAS.

Below is the error I get while testing the app and it disappears very soon and selected entities from the demo service are displayed however upon selection of an entity the respective records does not show up. I tried with some other services which does not contain period(.) and also with another onPremise service but the result is always same.

error : Failed to initialize application data service - Error: 500 (); GET /sapdemo/com.sap.edm.sampleservice.v2/ Internal Server Error

I have checked the BTP destination by replacing the Mobile service with a BTP service as per your suggestion however this time I got the below 404 error. On the other hand the Mobile service updates the metadata successfully.

error: Unable to fetch service metadata with the error <html><head><title>Error report</title></head><body><h1>HTTP Status 400 - </h1></body></html>

All my configurations are inline with the documentation you provided. Do you have any tip about where I can look at.

Thanks

regards

Yavuz

yavuzasik
Participant
0 Kudos

hi @subha8707_65

Were you able to find out the necessary resolution for your issue? I believe I am having exactly the same problem with you.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

yavuz.asik Please open a new question and provide your destination configuration for the BTP destination so we can review and provide feedback.