Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

FAQ: Gateway Client

$
0
0

Q1: What is the name of the transaction for the SAP NetWeaver Gateway Client?
The transaction name is /IWFND/GW_CLIENT.

 

 

Q2: How can I create a test case for the Gateway Client?
You can create test cases in two ways:

  • Manually: You have to set all information necessary for the OData request such as HTTP method, request header, and request body you want you issue.
  • Automatically from the Error Log or Payload Trace: From within the Error Log or Payload Trace click Replay and then save it as a test case.

 

To assist SAP Support you should always create a test case for the Gateway Client manually or via the Error Log or Payload Trace and write the name of the test group and test case in the incident.

 

 

Q3: How can I display the service configuration?
Once you have entered the Request URI, click Maintain Service to run the transaction /IWFND/MAINT_SERVICE on a new screen.

 

 

Q4: How can I display the service source codes (Model and Data Provider class)?
After you have entered the Request URI, click Service Implementation to run the transaction /IWBEP/REG_SERVICE where you can see the source codes for your Meta and Data Provider class on a new screen.

 

 

Q5: How can I display all entity sets of an OData  service?
After you have entered the Request URI, click EntitySets to display all the available entity sets for your service. Double-click an entity set to update the Request URI with the default HTTP Method GET and you can try to issue a read entity set.

 

 

Q6: What are the Add URI Options for?
Some useful URI options such as $count, $metadata, $skip, $top, sap-statistics=true can be added automatically to your request URI.

 

 

Q7: How can I change or copy test cases?
Click the icon Manage Test Cases and a popup is displayed in which you can:

  • Rename a test case
  • Rename a test group
  • Copy selected test cases to another test group
  • Move selected test cases to another test group

 

 

Q8: How can I copy test cases from the one to the other system?
There are two steps to perform:

  • Mark the test cases you want to copy and choose Menu->Gateway Client->Download to PC and choose a file name to download all selected test cases.
  • Login onto the target system, run transaction /IWFND/GW_CLIENT, and choose Menu->Gateway Client->Upload from PC. All selected test cases are subsequently copied to the target system under the same test group and test cases as in the original system.

 

 

Q9: How can I get some examples how to format a normal or a $batch request?
In the Gateway Client, choose Select and select the test group CORE_SAMPLES. If no test cases are found, choose Menu->Gateway Client->Create CORE_SAMPLES and choose Create All. Lots of samle test cases will be created in your system.

 

CAUTIONS:
If you want to run these test cases you have first to configure the service RMTSAMPLEFLIGHT with namespace /IWFND/ and TEA_TEST_APPLICATION with namespace /IWBEP/ in your SAP NetWeaver Gateway hub system.

 

Moreover, you have to generate some test data in your SAP Business Suite backend system as follows:

  • Run program SAPBC_DATA_GENERATOR in your SAP Business Suite backend system
  • Run program /IWBEP/R_SFLIGHT_CREATE_DATA in your SAP Business Suitebackend system

 

 

Q10: How can I test the functionality Server Paging using the service RMTSAMPLEFLIGHT?
Run program /IWBEP/R_SFLIGHT_SET_PAGING in your SAP Business Suite backend system to activate or deactivate the functionality Server Paging of the service RMTSAMPLEFLIGHT.

 

 

Q11: How can I add a media file as request body to create media file?
Click Add File to upload a media file from your PC and then set the HTTP Header Content-Type and Slug according to your service requirement.

 

 

Q12: What is the feature Data Explorer for?
The response payload of an OData request can be formatted as XML, JSON, and in the case of $batch request it can be a combination of these formats and plain text. Click Data Explorer to display the whole response payload in a user-friendly table.

 

Click Original Payload to go back to the original payload.

 

The Data Explorer is available from SAP NetWeaver Gateway 2.0 SP 08 onwards and supports the following features:

  • Expand or collapse the entries to have a better overview.
  • Double-click on a link to set the new Request URI for the next OData request. For example, you can use Data Explorer to display all entries of the return response. Double-click an entry to replace the request URI for read entity set with the selected read entity and you only need to execute the new request.
  • Click ABAP Convert and type in an ABAP structure or table to convert teh response data in the right format. This is necessary in following sample cases:
    • The OData format for time is, for example, PT09H33M22S and is not the same as in ABAP (09:33:22).
    • The timestamp in JSON format (for example, /Date(1386319756000)/) is not the same as in ABAP (20131206090224).

 

 

Q13: How can I define the request body for a create or update request?
First at all, you have to issue a read entity. Then click Use As Request to copy the entire response payload to the request payload. Now, you can edit some property values in the request payload and set the HTTP method to POST for create or PUT for update before issuing your new create or update request.

 

Example:
The response payload of a request /sap/opu/odata/IWBEP/TEA_TEST_APPLICATION/Employees(‘1’) can be used as the request payload for the update request with HTTP method PUT, request URI /sap/opu/odata/IWBEP/TEA_TEST_APPLICATION/Employees(‘1’) and Content-Type application/xml.

 

CAUTION:
You can only issue a create for an entity and not for an entity set.  Therefore, do not copy the response payload of a read entity set and use as request. If you do this, you will get an error response with the error text: “System expected the element ‘{http://www.w3.org/2005/Atom}entry'”

 

 

Q14: How can I define the request body for a deep insert?
First at all, you have to issue a read entity with $expand. Then click Use As Request to copy the entire response payload to the request payload. This is helpful as the response body of an entity with $expand has the same structure as the request body of a deep insert.

 

Example:
The response payload of a request /sap/opu/odata/IWBEP/TEA_TEST_APPLICATION/Employees(‘1’)?$expand=My_Team can be used as the request payload for the deep insert with HTTP method POST, request URI /sap/opu/odata/IWBEP/TEA_TEST_APPLICATION/Employees and Content-Type application/xml.

 

CAUTION:
You can only issue a deep insert for an entity and not for an entity set.  Therefore, do not copy the response payload of a read entity set with $expand and use as request. If you do this, you will get an error response with the error text: “System expected the element ‘{http://www.w3.org/2005/Atom}entry'”

 

 

Q15: How can I run different test cases with one click?
You can select all available test cases and mark the test cases you want to test and click Execute. We recommend you to assign the test cases to one specific test group and then select this test group, mark all test cases of this test group and click Execute.

 

The check is only based on the HTTP status code of the response. Here you can define all available HTTP status codes of a request. To do this you have to mark the test case and click Set Expected Status. Press F1 on HTTP Status Code to see how to format all available expected status codes.

 

 

Q16: Does the Gateway Client support the check of return application data?
No, but you can write your own test program using some API which is used by the Gateway itself to run, check, and display the response payload.

 

 

Q17: Can I use some API to implement my own test program?
Yes, once you have defined your test cases, you can use the following API to write your own test program processing these test cases:

  • Class /IWFND/CL_SUTIL_CLIENT_PROXY and the specific method WEB_REQUEST can be used to issue a generic OData request.
  • Class /IWFND/CL_SUTIL_GW_CLIENT_EXEC and different methods to execute a test case, a test group or different test groups (test groups will be processed in parallel mode).

 

Using this API you can only check the HTTP status code of the response but it is not easy to check the return application data because they are in XML, JSON or §batch format.

 

 

Q18: Can I use some API to easily check the return application data in my test program?
Yes, but only from SAP NetWeaver Gateway 2.0 SP 08 onwards. You have to extend your test program above to use the following API to map the response body in XML, JSON or $batch format into a user-friendly table form (Data Explorer feature of the Gateway Client) and/or to convert the response body to an ABAP structure or table before check.

  • Class /IWFND/CL_SUTIL_ODATA_MAPPER, method GET_BUSINESS_DATA maps the response body in a user-friendly table form.
  • Class /IWFND/CL_SUTIL_ODATA_MAPPER, method CONVERT_TO_ABAP maps the response body in an ABAP structure or table.

 

 

Q19: Can I run some specified test cases in an automatic way?
Yes, you have two options to do this:

 

Option 1:  Unit Test
Your test program to check the HTTP response status code and verify the return application data as described above should be realized as a unit test program. The pre-condition is your system must be configured to run the ABAP unit test.

 

Option 2:  Batch Job
Your test program to check the HTTP response status code and verify the return application data as described above should be scheduled as a batch job (transaction SM36).

 

 

Q20: Is there any limitation regarding the payload size of a response in the Gateway Client?
The Gateway Client doesn’t have any limitation regarding the payload size but it uses the SAPGUI/SAPLOGON to display the payload in XML, JSON format or in a table form (Data Explorer feature). Therefore, it might take several minutes to receive and display a very large payload or to map received data into the table form.

 

As a very large payload (more than 100 MB) might lead to a SAPGUI/SAPLOGON termination, the maximum body size is set to 10 MB per default. Response payload larger than this maximum body size won’t be displayed in the Gateway Client (warning text “Response body is too large …”) but you can click Response in Browser to see the whole response payload via your default internet browser.

 

Click Menu->Edit->Set max. Body Size and set the new maximum body size to change it for your own requirements.

 

 

Q21: Can I display the request and response payload in a user-friendly table form instead of JSON or XML or batch format?

Yes, this is available from SAP NW Gateway 2.0 SP08 onwards. Click the so-called Data Explorer in Gateway Client to display the request or response body in a table form. See chapter about Data Explorer in Gateway Client in Some new features in SAP NW Gateway 2.0 SP08 for more details.


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>