Extending A Service Using The Gateway Service Builder - SAP Blogs

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

2/10/2020 Extending a service using the Gateway Service Builder | SAP Blogs

Community

Ask a Question Write a Blog Post Login

Former Member
August 8, 2014 5 minute read

Extending a service using the Gateway Service Builder


Follow RSS feed Like

11 Likes 15,447 Views 10 Comments

In this blog, I will introduce the service extensibility concept that was developed as part of the SP09 development for the SAP NetWeaver Gateway Service Builder.

Motivation: The motivation behind the service extensibility concept was to have a single service URL for both the original service and the new service (which is generated by rede ning the
original service). This will enable users to rede ne a particular service as per the requirements but still access the new rede ned service using the URL of the original service.

Prerequisites:

IW_BEP 200 SP09

Step-by-Step Procedure

Following are the step by step procedures to extend a particular service. I will rede ne an original service into a new rede ned one and then showcase the service extensibility functionality.

Creation of a “Service with SAP Annotations” or “Service with Vocabulary-Based Annotations” service

Create a new service by rede ning the original service

Extend the service while generating the runtime artifacts

Check the service URLs

Creation of a “Service with SAP Annotations” or “Service with Vocabulary-Based Annotations” service

1. Go to the transaction SEGW and create a new project by clicking on

2. Enter the details for the Project, Description, and Generation Strategy. Select project type as “Service with SAP Annotations” or “Service with Vocabulary-Based Annotations” from the drop-down. I have
mentioned the project name as “z_srvext_parent” for better comprehension.

https://blogs.sap.com/2014/08/08/extending-a-service-using-the-gateway-service-builder/ 1/10
2/10/2020 Extending a service using the Gateway Service Builder | SAP Blogs

    

     3. Create few entities for this project by right clicking on “Data Model” and selecting “Create Entity”. Or you could also right-click on the “Data Model” and                select the “Import”
mechanism to import a data source. I will import a RFC in this example.

       

     4. I now have the service as follows. Let’s call this the “parent” service.

    

     5. Generate the Runtime artifacts by clicking on . In the following dialog Click Continue.

https://blogs.sap.com/2014/08/08/extending-a-service-using-the-gateway-service-builder/ 2/10
2/10/2020 Extending a service using the Gateway Service Builder | SAP Blogs

    

     The runtime artifacts for this “parent” service will be generated.

Create a new service by rede ning the original service

1. Let’s now create a new “Service with SAP Annotations project” and rede ne it from the “parent” service. Navigate to the SEGW transaction and create a new service as follows.

    

     Let’s call this the “child” service.

2. Right Click on the Data Model and select Rede ne -> OData Service (GW).

3. In the following wizard, enter the values for the “parent” service and click “Next”.

https://blogs.sap.com/2014/08/08/extending-a-service-using-the-gateway-service-builder/ 3/10
2/10/2020 Extending a service using the Gateway Service Builder | SAP Blogs

4. Select the entity of the “parent” service in the next wizard as follows and click on “Finish”.

5. Add another entity to this service by right-clicking on Data Model and selecting Create -> Entity Type.

Add a property for this entity. (I have tried to keep the entities and properties to be as simple as possibleJ). The “child” project now has two entities as shown below.

6. The “child” project now looks like as follows:

https://blogs.sap.com/2014/08/08/extending-a-service-using-the-gateway-service-builder/ 4/10
2/10/2020 Extending a service using the Gateway Service Builder | SAP Blogs

The “parent” service appears under the Model References folder.

Extend the service while generating the runtime artifacts

1. Generate the runtime artifacts for this “child” service by clicking on . The following dialog opens up.

The Overwrite Base/Extended Service under “Service Extension” is by-default unchecked. Once checked, we get the warning “Base service will be inaccessible” and the Technical Service Name
and the Service Version elds get lled with the values of the “parent” service that was entered in step 3.

(If the checkbox Overwrite Base/Extended Service is checked, the service extensibility concept comes into play. The service URL of the “parent” service (Z_SERVICEEXT_PARENT) will now be
re-directed (i.e. fetch the service details) to the “child” service (Z_SERVICEEXT_CHILD).

2. We will now register this service in the SAP NetWeaver Gateway Hub system. Click on Service Maintenance and select the Hub system and click on Register.

   Click Ok and enter the system alias in the next dialog. Enter the package in the subsequent dialog and click Ok.

https://blogs.sap.com/2014/08/08/extending-a-service-using-the-gateway-service-builder/ 5/10
2/10/2020 Extending a service using the Gateway Service Builder | SAP Blogs

  

3. Register the “parent” service as well by following the same steps as above. Now since we have both the “parent” as well as the “child” services registered, we       can check the service URLs.

Check the service URLs

1. Navigate to the “parent” service -> Service Maintenance, select the Hub system and click on Gateway Client to check the service details.

  

   2. In the Gateway Client window, enter the details as mentioned in the picture below and execute to see the service details.

  

Alert Moderator

Now, in the metadata of the “parent” service, we can see the two entities associated with the “child” service. This happens because the service URL of the “parent” service gets redirected to the
Assigned tags as the “child” service has extended the “parent” service.
“child” service

BothGateway
SAP the “parent” and the “child” |service
| netweavergateway sap |can
sapbe accessed
netweaver using the
gateway URL of the “parent”
| servicebuilder | service.

View more...
Hope this post helped you get a perspective on the service extensibility concept in service builder

Related Blog Posts

How to transport Fiori like applications using SAP Solution Managers Quality Gate Management
By Andre Fischer , Jul 07, 2014
Create Standalone Annotation using SAP Gateway Service Builder
By Former Member , Aug 16, 2014

SAP NetWeaver Gateway Course Available – GW100 – Building OData Services


By Andre Fischer , Apr 23, 2012

Related Questions

https://blogs.sap.com/2014/08/08/extending-a-service-using-the-gateway-service-builder/ 6/10

You might also like