Skip to Content
Author's profile photo Carlos Roggan

Integration Gateway: Understanding REST data source [11]: DELETE operation

This  blog is about Integration Gateway in SAP Mobile Platform 3.0 (SMP).

It is a follow-up of the previous blog, where I explained how to implement the CREATE operation for your OData service, based on a REST data source.

Since SMP SP07, DELETE operation is supported by Integration Gateway.

If you’re new to the topic, check the Links section below where you can find the tutorials which get you up to speed.


The sample REST service is now made available for public usage, so I’ve updated the tutorial to use it.

Also, the code is attached to this blog.


I expect that you’ve gone through my previous tutorials, explaining REST data source – QUERY and READ and CREATE operation – based on XML payload.

Please check the Links section for the relevant blogs.

Furthermore, you need:

  • Eclipse with SAP Mobile Platform Tools installed
  • SMP SP07
  • Basic knowledge about OData provisioning using the Integration Gateway component of SMP


REST Service

For this tutorial, we need a REST service that supports writing scenario.

I’m using a service that is public available, you only need to sign up, afterwards you can access it with your SCN  user and password.

Please see the following document for details:

Getting started with the SAP Netweaver Gateway Service Consumption System

Finally, you should be able to access it via the following URL:


In your SMP, you need to create an HTTP destination to the following URL:

Furthermore, you need to download the certificate and import it into your SMP keyStore.


For this Destination, it isn’t possible to do a “Test Connection”, as the server doesn’t send a valid response.

As a workaround, you can proceed as follows:

Create a second destination, which is only used to test if the target host can be reached.

This second destination points to a URL that actually can send a valid response.

For example, enter the following URL as destination URL:

So, you use this second destination to do the “Test Connection”.

If this succeeds, then the first destination should be fine as well.

This first destination will be used to configure our OData service, that we create in this tutorial.

If you get an error message on connection test, you might consider the following:

Note that you might need to enter proxy settings in your SMP:

https://localhost:8083/Admin/ -> Settings-> System

Note that you might need to restart the SMP server after changing the proxy settings.

OData Model

The OData model for this tutorial is the same like in the previous tutorial:

You can simply continue with the project that was created for the previous tutorial.

Bind data source

The Relative URI is the same like for the READ operation


Please check my previous tutorials for explanation about how to compose the Relative URI

Custom Code

Generate the Custom Code for Groovy.

For the DELETE operation, we don’t have to implement anything.


In the processRequestData() method, there’s no special requirement regarding request header or request body

In the processResponseData() method, no response body will be returned, according to OData specification.


If your backend requires additional handling, then of course you have to provide the implementation here

For example, my backend REST service requires the x-requested-with header to be set, while sending the request.

Therefore, I’m adding the following line to the processRequestData() method

def Message processRequestData(message) {

    message.setHeader(“x-requested-with”, “XMLHTTPRequest”);

       return message;



In order to test the DELETE  operation, proceed as described in the previous tutorial.

The response status code should be 204 No Content and the response body should be empty, as can be seen in the screenshot below.


In this tutorial, we’ve learned how to implement the DELETE operation in a Groovy script.

We’ve seen that it’s easy, as no implementation is required to fulfill the task


Installing SMP Toolkit:

Tutorial for OData provisioning in SMP:

Preparing Eclipse for Groovy scripting:

Introduction in REST datasource part 1: Understanding the return structure in xml

Introduction in REST data source part 2: Understanding the return structure in json–json-very-simplified

Introduction in REST data source part 3: Implementing the QUERY operation–xml-standard

Introduction in REST data source part 7: Implementing the READ operation–xml

Introduction in REST data source part 9: Implementing the CREATE operation

Overview of all REST blogs

The official documentation:

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.