Skip to Content

Use the Sample OData Service for Mobile Apps

Use the sample OData service included with the SAP Mobile Services for development and operations account.
You will learn
  • How to access the sample OData service that comes with the SAP Mobile Services for development and operations
  • How to generate sample data for use in your application
qualitureRobin van het HofMarch 31, 2021
Created by
qualiture
March 28, 2017
Contributors
qualiture

Prerequisites

  • Development environment: Apple iMac, MacBook or MacBook Pro running Xcode 9 or higher
  • SAP BTP SDK for iOS: Version 2.0

A sample OData service is available for developers to use during development and testing. Administrators can configure the sample service via the cockpit. You can view the root service and metadata URLs, and generate sample sales orders and purchase orders for multiple entity sets. You can also view the data for each entity in a separate text file, and reset the sample data.

You can configure only one sample OData service per tenant.

The following roles are required to use this service:

Role Service URL Description
Developer <JAVA application URL>/mobileservices/SampleServices/ESPM.svc/ Access the sample OData service
Administrator /mobileservices/Admin/ESPM.svc/ Administrators configure an application in the cockpit to enable the service for the developer
  • Step 1

    In SAP Mobile Services for development and operations cockpit, navigate to Developer.

    Developer tab
  • Step 2

    To view the service information, click the URL next to Root URL.

    To view the schema metadata for the service, click the URL next to Metadata URL.

  • Step 3

    In order to use the sample service, you need to generate some sample data first.

    1. Click the Generate sample sales order button to generate 10 sample sales orders.

    2. Click the Generate sample purchase order button to generate 10 sample purchase orders

    Every click on each button will add another 10 sample orders to the Sample OData service.

  • Step 4

    Navigate to Applications, and next to the com.sap.tutorial.demoapp.Demo application, click the Action button, and select Configure.

  • Step 5

    Under the Information tab, make sure Security Configuration is set to Basic:

    Developer tab
  • Step 6

    Switch to the Back End tab and define a connection to the sample OData service URL:

    Field Value
    Back-End URL https://hcpms-YOURIDtrial.hanatrial.ondemand.com/SampleServices/ESPM.svc/
    Proxy Type Internet
    Rewrite Mode Rewrite URL
    Application backend
  • Step 7

    At panel SSO Mechanism, set the authentication method to Basic Authentication:

    Authentication

    For the SSO Mechanism for the sample OData service, you can choose between Basic Authentication or App2AppSSO. In one of the next tutorials, we will use the SAP BTP SDK Assistant for iOS to create an application based on this Sample OData service, and since the SAP BTP SDK Assistant for iOS currently only supports Basic Authentication, we will use the Basic Authentication setting.

  • Step 8

    Mark the checkbox next to Basic Authentication, and click the Edit button to the right. A dialog is shown, and enter your SAP Mobile Services for development and operations login credentials

    Authentication

    Click Save to close the dialog.

  • Step 9

    Click Save to store the back-end configuration.

    For now, this complements this tutorial step. In the following tutorials, you will actually query the OData service and display the results.

    What are the entities created for the sample OData service ?

Back to top