Show TOC

SAP Gateway ClientLocate this document in the navigation structure

SAP Gateway Client (transaction /IWFND/GW_CLIENT) for SAP Gateway is a powerful tool that provides the freedom to test any OData service. This enables you to test an OData service pro-actively and run a quality assurance test before a service is used by a mobile application, for example.

In short, SAP Gateway Client enables you to:

  • Reproduce (replay) runtime situations that led to a particular error (reactive error resolution).

  • Simulate a service at runtime to identify and resolve potential issues before a critical showdown arises (proactive error prevention).

  • Obtain SAP performance statistics.

  • Create and save all test cases for OData services and replay these test cases at any time. Depending on your requirements, you can store the test data either on your local PC or in an underlying database. This opens a new window in which the entity set names that exist for the service are listed.

If you want to maintain the service, you can navigate directly from SAP Gateway Client to the Activate and Maintain Services activity in the SAP Gateway hub system by choosing Maintain Service. Alternatively, you can choose Service Implementation to maintain the service in the SAP Business Suite backend system.

Implementation

SAP Gateway Client acts as an HTTP client enables you to test HTTP responses as they would arise at runtime. To test an HTTP or HTTPS response, proceed as follows:

  1. Select the HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) you want to use.

  2. Enter the request URI you want to test in the Request URI input field. To make your request more precise, you can add a URI option that is appended to the URI you enter in the Request URI field. Choose Add URI Option to select the appropriate URI option from a dropdown list of restrictions, for example, $count or $format=json. To manage the URI options available for selection, choose Start of the navigation path Edit Next navigation step Manage URI Options End of the navigation path where you can enter additional URI options or delete existing URI options.

  3. Enter the name of the HTTP header in the Header Name field, for example Content-Type and the value such as application/atom+xml..

  4. In the HTTP Request screen area, you can enter your service data (request payload) or you can upload the service data you want to test from a local file, for example. To upload a file, choose Add File in the HTTP Request screen area. The header name and value (file type, for example, .xml, .pdf, .jpg) of the HTTP request is displayed in a table and, below this, you can see a preview of the HTTP request file itself. To remove the file from the HTTP request, choose Remove File.

  5. Choose Execute.

  6. The SAP Gateway Client displays the HTTP response in the HTTP Response frame on the right-hand side of the screen. If an error arises as a result of the test, the HTTP status and value is displayed in a table above the preview field. You can display details of the HTTP response, display the response in an additional browser window, or navigate to the Error Log to correct the error.

    If you want to reuse the HTTP response as an HTTP request, choose Use as Request to copy all the relevant response data to the HTTP Request automatically without the need for additional formatting.

    If you want to work with a HTTP request without the HTTP Response screen area being displayed , choose the Resize Screen icon in the HTTP Request screen area. This extends the HTTP Request screen area across the entire width and hides the HTTP Response screen area. Conversely, if you want to work with an HTTP response without the HTTP Request screen area being displayed, choose the Resize Screen icon in the HTTP Response screen area.

    For greater usability, the SAP Gateway Client enables you to download XML requests from the SAP Gateway Client to your local PC or vice versa to upload an XML request from your local PC. To do this, choose Start of the navigation path SAP Gateway Client Next navigation step Download to PC End of the navigation path, or Start of the navigation path SAP Gateway Client Next navigation step Upload from PC End of the navigation path. Further, you can choose Start of the navigation path SAP Gateway Client Next navigation step Call Browser End of the navigation path to call the request URI via HTTP or HTTPS.

If you want to view the service metadata in a separate browser, choose Service Metadata. If you want to view the entity sets that exist for the service, choose Entity Sets. Double-click an entity set name to have this appended to the request URI and simulate the call for the specific entity set.

Working with Test Cases

SAP Gateway Client is integrated with an underlying database, thereby providing you with increased flexibility to access request data already stored in the database for further testing, or save your own test cases to the database as required. This can save time and effort if you want to execute test cases more than once. As standard, SAP delivers the test group CORE_SAMPLES, which contains sample data for testing. To use the core samples delivered by SAP choose Start of the navigation path SAP Gateway Client Next navigation step  Create CORE_SAMPLES End of the navigation path. You can either create all test cases in the system, or only update new ones.

You can also upload test cases to the database from your PC. To do this, choose Start of the navigation path SAP Gateway Client Next navigation step Upload to DB End of the navigation path. After you have navigated to the file you want to upload and selected it, SAP Gateway Client prompts you to specify whether all test cases contained in the upload files are to be updated, or if only new test cases are to be updated. Choose Upload All or Update Only depending on your requirements. After the file has been uploaded successfully, an information message is displayed in which you are instructed to choose Select to access the uploaded test cases.

You can adapt the existing test cases or define and save your own test case.

  • To save your request to the database as a test case, choose Save. In the Save Test Case dialog box, enter a test group and a name for the new test case. After you have saved a test case, the name of the test group is displayed in the Test Group field and the name of the test case in the Test Case field.

  • To select an existing test case from the database, choose Select. In the Select Test Cases dialog box, you can enter the service namespace in which the service you want to test resides, for example, /IWBEP/, and an existing service name, an existing test group, or test case. Choose Enter. If you leave all fields blank and choose Enter, you can select a test case from the SAP CORE_SAMPLES test group.

If more than one test case exists based on the criteria you entered in the Select Test Cases dialog box, the test cases are displayed on the SAP Gateway Client — Select from Database screen. The SAP Gateway Client lists test cases found in the database together with the name of the test group, for example, CORE_SAMPLES, test case name, HTTP method, expected status, request URI, and the user who last changed the particular test case. Select the line in which the relevant test case is displayed and choose Request Data to display the HTTP request or choose Execute to run the test. If required, you can select more than one test case and run the tests in parallel.

The SAP Gateway Client checks the HTTP response status against a list of available statuses to be expected. Depending on the test case you want to test, you might need to change the expected status. To change the expected status, choose Set Expected Status and the Set Expected HTTP Status dialog box is displayed where the current expected status is shown in the HTTP Status Codes field. If you want to replace the expected status currently displayed for the selected test case in the results table, delete the current status and enter the new status you expect to be returned and choose Enter. For all requests, except $batch, the statuses and status ranges you enter must be separated by a space, for example 200 400 (multiple statuses separated by space) or 201 401–403 (multiple statuses including status range separated by a space). If you want to change the expected status for a $batch request, which can contain one HTTP response status for the $batch request and different HTTP response statuses for the multiple operations within the $batch request, you must enter the expected HTTP responses in the following format: <status of $batch>/<statuses of 1.operation separated by '_'>/.../<status of n.operation separated by '_'>, for example, 202/201_400-499/204_400. You can also display the format of expected statuses described here by pressing F1 in the HTTP Status Codes filed in the dialog box Set Expected HTTP Status.

If you want to rename an existing test case, for example, select the relevant test case and choose the Manage Test Cases pushbutton. If you want to rename the test case, select the Rename Test Case radiobutton and enter the new name in the New Test Case field. The Manage Test Cases function enables you to rename test cases and test groups, copy selected test cases to another test group, and move selected test cases from one test group to another. Select the relevant radiobutton and enter the new name as required.

For greater usability, the SAP Gateway Client enables you to download different test cases to one file on your local PC or to upload test cases from your PC to the underlying database. To do this, choose Start of the navigation path SAP Gateway Client Next navigation step Download to PC End of the navigation path or Start of the navigation path SAP Gateway Client Next navigation step Upload to DB End of the navigation path. This function is helpful if you want to transfer test cases from one SAP Gateway hub system to another.

Note

If you want to enter new criteria to search for test cases, go back to the SAP Gateway Client and choose Re-Select.

Interpreting the Test Results

After you have run the test for one or more test cases, the results are displayed in a table on the SAP Gateway Client — Multiple Test screen. At a glance, you can see the status of the test indicated by a traffic light icon together with the date and time the test was run, the test group to which the test case belongs, the HTTP method, HTTP response, expected status or statuses, descriptive error text, and request URI. On this screen, you can choose to display the request or response data for more context information.

If errors arose, you can select the affected test case and choose Error Log to examine the error details. You can also test the test case again by selecting the relevant row(s) and choosing Re-Test. Before re-testing a particular test case, you might want to change the expected status and to do this you choose Set Expected Status. In the Set Expected HTTP Status dialog box, select Use current status as expected status to run the test again with the same expected response status or select Set specific status code to change the expected response status from the previous test run and enter a new status code in the HTTP Status Codes field. After you have changed or checked the expected status for the test case, choose Re-Test to repeat the test.

Integration with SAP Gateway Error Log

SAP Gateway Client and SAP Gateway Error Log are integrated with one another. Therefore, if you need to reproduce a problem recorded in the Error Log for further analysis, double-click the relevant error in the Overview screen area of the Error Log to show the context information in the Error Context screen area. In the Error Context screen area, choose Replay to call the SAP Gateway Client with the same data and HTTP request. This enables you to reproduce the exact runtime situation that led to a particular error without accessing the actual HTTP client such as a mobile application.

For more information, see Error Log.

SAP Performance Statistics

You can obtain SAP performance statistics using the SAP Gateway Client. For more information, see the SAP NetWeaver documentation about SAP Performance Statistics.