Skip to Content
Author's profile photo Arijit Laha

Copy Gateway Service from One server to another server using EDMX file

When there is a requirement to copy a particular gateway service from one server to another server, the most time consuming part is to copy the data model manually by creating all the entities, entity sets, associations and navigation paths.

Now to overcome this big trouble, there is a better way given by SAP. There is an option called “Data Model From File”.

The goal of this document is to provide the steps to use this option “Data Model from File”.


    1.    Generate METADATA:

Suppose we want to copy the Gateway Service “ZTEST_SALESORDER”. Then first of all we have to generate the $metadata of this service. For this we        have to go to Service Maintenance and select the System for which the Service Registration has already been done. Then click the button “Maintain”.


This will give a pop-up message, click yes.


This will open the “Activate and Maintain Services” screen.


Here click on the button “Gateway Client”. This will open SAP NetWeaver Gateway Client screen.

To directly open SAP NetWeaver Gateway Client screen one can use the Tcode /iwfnd/gw_client


Now to get the METADATA add $metadata at the end of the URI as below:


Click F8.

Now the entire METADATA of the data model will be displayed inside the HTTP response section.


2.    Create EDMX file

Copy the entire metadata from the previous step and paste it in a text file. After that save the text file with the extension .edmx

    3.    Use EDMX File to copy the data model into a new service

Now we will create a new Project from transaction SEGW (SAP NewtWeaver Gateway Service Builder).


Now right click on Data Model and select the option Import -> Data Model From File


Chose the EDMX file that we have saved in the previous step.


    Click “Open”.

    Now check the service in SEGW. All the entity, entity sets, associations, association sets, navigation paths are automatically copied into the newly      created service.


    After that the Runtime Objects can be generated for the service and accordingly the Service Implementations can be copied.

  Appendix(Copy Standard Service):

    Here in the above example I have considered a custom service to be copied.  If you want to copy any standard service then you should follow the below      steps to get the metadata of the service.

    Open the TCODE /iwfnd/maint_service

    This will display the entire service catalog of the system. Select the one that you want to copy from the service catalog and then click on the button      Gateway Client.


After that please follow the previously discussed steps.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Pavan Golesar
      Pavan Golesar

      Helpful !

      Was Searching for this. 😳



      Author's profile photo vivek gaurav
      vivek gaurav

      Nice process but it does not copy business logic of DPC class.

      Author's profile photo A J
      A J


      How to create edmx file from txt file?

      I'm not getting the file type .edmx in my system.

      Leads are appreciated..


      A J

      Author's profile photo Sean Machado
      Sean Machado

      This is great, but I would like to make one comment.

      Copying the metadata and pasting into a file which we would then rename with an EDMX extension did not work for us.

      Instead, we right-clicked in the HTTP Response preview screen and selected "Select All". Then we right-clicked again to "Save Target as". When the "Save As" prompt popped up, we changed the Save As Type from XML to All Files. Then we made sure the File name had the EDMX file extension.

      Then it imported fine for us.




      Author's profile photo Zayidu Ansari
      Zayidu Ansari

      Thank you! Made the job much easier!