Escolar Documentos
Profissional Documentos
Cultura Documentos
Hi, Guest
Log On
Store
Join Us
Products
About SCN
Downloads
Industries
Partnership
Developer Center
Lines of Business
University Alliances
Innovation
Activity
Communications
Actions
Brow se
Version 4
created by Krishna Kishor Kammaje on Oct 14, 2013 2:45 AM, last modified by Krishna Kishor Kammaje on Jul 10, 2014 3:44 PM
Share
Tw eet
In this document I explain beginners on how to use the SAP provided Gateway Client to test your
OData services.
You access the Gateway Client using Tcode /IWFND/GW_CLIENT
We consider the SAP delivered demo service /IWFND/RMTSAMPLEFLIGHT for our use cases.
Step 2. Once I get the response, I click on Use as Request button, which will populate the
request body same as the current response.
http://scn.sap.com/docs/DOC-47626
1/5
12/11/2014
Step 3. Now change the values in the request body as required. You need to change the key
value as there cannot be more than one record for a particular combination of a key. In
applications where keys are populated by the application, you may leave them as blank. I
changed the key value as 90000055 and NAME as Sunshine Travel New
Step 4. Change the URI as /sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/TravelagencyCollection
In the above screenshot you can also notice that XCSRF-Token header is auto populated so
making it easy for you.
Step 5. Change the HTTP method as POST and hit F8. You are done! You should get a return
HTTP response as 201: Created indicating a successful Create and also returning the created
entity in the response body.
1.2 Testing an UPDATE
Step 1. Same as Step 1 that in the CREATE.
Step 2. Same as Step 2 that in the CREATE. Here you read an entry that you want to Update
Step 3. Here keep the URI as it is. URI should be containing the keys of the record to be
updated.
Step 4. Change the request body that got populated, changing non-key properties.
Step 5. Change the HTTP Method as PUT Hit F8; you are done. You should get a return HTTP
response as 204: No Content indicating a successful Update. Note: In the sample service
above you can update a record which you created. Not the one which already exists.
1.3 Testing a Deep Insert
Hand coding a Deep Insert body is a very tedious job. Here first you need to execute a
$expand query. I take a different example this time. Now I want to create a Carrier with Flights
for that Carrier. I see that Navigation carrierFlights navigates from Carrier to Flights
Step 1. Run a query with below URI:
/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/CarrierCollection('AA')?$expand=carrierFlights This
will give me Carrier AA, along with all its flight.
Step 2. Hit Use as Request button as we did previously.
Step 3. Notice that we have Carrier as well as Flights in the request body. Flights are within the
node <inline> and at last you have the Carrier record. Change the keys as required. For
example inside the Carrier entry I put a new non-existing carrid say ZZ and change some
other non-key fields. Inside the flight entries, I change the carrid as ZZ as well. You may remove
many flight entries and keep one or two as required.
Step 4. Change the HTTP method as POST Hit F8, you are done.
Note: The above example may not run successfully because of Virus scan settings of ES1 (Virus
Scan comes into play since CarrierCollection is marked as hasStream=True; Deep insert itself
does not need any Virus scan setting). In your system this has to run fine.
http://scn.sap.com/docs/DOC-47626
2/5
12/11/2014
This will open the corresponding request in Gateway Client thus allowing you to see the request as
well as the response.
Step 2. Once saved, you can click on the Select button (next to Save) and retrieve your test case.
Step 3. You can store multiple test cases under a Test Group as below. You can set expected status
by clicking on the button as shown below.
http://scn.sap.com/docs/DOC-47626
3/5
12/11/2014
Step 4. You can run them any point of time in future and ensure that they are running as expected.
You can also look at the Request Data and change them as well. After setting the Expected Status,
select all requests as click on Execute as below.
Note that I have purposefully given a wrong Expected status for demo purpose.
Below is the output after executing
I tried here to highlight the most useful features of Gateway client. Hope it helps in your
development of Gateway services.
4390 View s
Products: sap_netw eaver_gatew ay Topics: mobile Tags: sap, mobility, rest, sap_netw eaver_platform, gatew ay, odata,
troubleshooting, debugging, sapui5, sap_mobile_developer_center, trouble_shooting, gatew ay_client
Average Us er Rating
(5 ratings )
http://scn.sap.com/docs/DOC-47626
4/5
12/11/2014
Share
Tw eet
4 Comments
Site Index
Privacy
Contact Us
Terms of Use
http://scn.sap.com/docs/DOC-47626
Copyright
Follow SCN
5/5