Skip to content

Create Services

A service file defines a destination pointing to an OData or REST backend. After you create your new Mobile Development Kit project, a Services folder with your .service file and .xml file is automatically created under your project. The .xml file contains the metadata definitions if the service file is pointing to an OData service.

Prerequisites

You must have a valid Mobile Development Kit project.

Procedure

  1. Under your newly created project, right-click the Services folder and click MDK: New Service.

  2. In the Service wizard:

    Field Description
    Name Enter a service name.
    Data Source Select a source from the drop-down. The available source types are: BTP Destination, Mobile Services, Service URL and Local File.
    Mobile Services Landscape Select your Mobile Services Landscape from the pop-up. This pop-up appears only when you have selected Mobile Services as the Data Source type. There are three options available for landscape: standard, preview, and neo. The first two options are for the Cloud Foundry environment. If you have Mobile Services Preview edition available in your Cloud Foundry account, choose preview. Choose neo for the Neo environment.
    Application Id Select an application from the pop-up. This pop-up appears only when you have selected Mobile Services as the Data Source type. This is the application that you've created in mobile services.
    Service URL Enter the Service URL. This field appears only when you have selected Service URL as the Data Source type.
    Destination Select a destination from the drop-down.
    Local Metadata XML Select an XML file from the local files. This field appears only when you have selected Local File as the Data Source type.
    Path Suffix Append a path to your OData service if required.
    Language URL Param sap-language is the default value. However, you can provide a different value.
    Enable offline By default, it's enabled. Select No to disable it.
    REST Service By default, it's disabled. Select Yes to enable it.

    Click Check Service to fetch the metadata from the destination, and the data will be shown in the right side table.

  3. Choose Finish.

    A new service is created under the Services folder and the metadata will be stored in the .xml file.

  4. To start working with a service, double-click it or right-click and choose Open With and then select OData Service Editor or Code Editor. You can click Sync Service to fetch the metadata from the destination.

Note

If you are not logged in to Cloud Foundry, Cloud Foundry Sign In page will be appear. You can use the following methods to sign in:

  • Credentials

    Enter your username and password. Click Sign in. Select Cloud Foundry Organization and Space. If the login attempt fails, you will not be able to use Mobile Services Data Sources.

  • SSO Passcode

    Click the link to open a new browser page, choose to generate a temporary authentication code, copy the SSO Passcode and paste it back in the Cloud Foundry Sign In page.

Changes made in the service editor simultaneously appear in the code editor.

OData Service Editor

The OData Service Editor view contains other options for your service:

  • Headers
  • Service Options
  • CSDL Options
  • Store Parameters

Code Editor

The Code Editor view displays the codes for your metadata elements. As you add or modify contents in the OData Service Editor, the changes simultaneously reflect in the Code Editor.


Last update: April 22, 2024