Documenting, testing and validating SAP NetWeaver Gateway projects

By Geert-Jan Klaps

SAP NetWeaver Gateway allows you to make SAP system data accessible on mobile devices. Creating APIs is simple, but obtaining business validation can be challenging. This is because APIs lack GUIs. In this blog, we explore three popular solutions: SAP NetWeaver Gateway Client, Postman collections and OpenAPI. Unfortunately, each has limitations, such as lacking combined documentation and testing of SAP NetWeaver Gateway services. Fortunately, TheValueChain has a solution, so let's take a closer look. 


SAP NetWeaver Gateway Client 

The standard way to have an API validated is to create test cases, clustered in test groups, in the SAP NetWeaver Gateway Client. Blog Geert-Jan picture1 | TheValueChain

As a functional analyst, you can select a test case, manipulate the predefined request body to fit the test scenario and execute the API call.

Blog Geert-Jan picture2 | TheValueChain

This approach has several advantages: 

  • Standard SAP solution 
  • Automatic CSRF token handling for modifying requests 
  • Automatic retrieval of supported entity sets 
  • All available URI options can easily be selected from the main menu 

It also has a few drawbacks: 

  • It is a rather technical approach: each basic scenario needs to be prepared by the developer 
  • The functional analyst or user needs to understand the OData metadata to create their own requests for cases that were not prepared by the developer 

It’s a test tool only, not a documentation tool 

 

Postman collections 

Postman is a useful tool for testing REST APIs, and API calls can be organised into collections for easy use. However, the free version limits requests to 20 and Postman does not automatically handle CSRF tokens for modifying requests. To work around this, a user can create a Postman environment and test cases for the CSRF token request, but the user must still manually execute the request before any modifying request. 
 

Blog Geert-Jan picture3 | TheValueChain

Postman advantages: 

  • More intuitive than SAP NetWeaver Gateway Client 
  • Easy grouping of requests into collections and folders 

Disadvantages: 

  • No automatic CSRF token handling  
  • Request sharing is limited in the free version 
  • This is a test tool only, not a documentation tool 

 

OpenAPI documentation 

One of the standards in API documentation is the OpenAPI standard. You can use it to fully describe and document the API functionalities using JSON or YAML. A tool like Swagger UI enables you to generate interactive documentation that allows users to test every functionality provided by the API. 

Blog Geert-Jan picture4 | TheValueChain

However, there is no standard way to create a valid OpenAPI JSON or YAML file from an SAP NetWeaver Gateway service. That is why creating this type of documentation is quite cumbersome, complex and time-consuming. 

OpenAPI has some powerful characteristics, such as: 

  • Universal way of describing a REST service 
  • Interactive documentation capabilities 
  • Capable of being imported into several API management tools, including SAP Cloud Platform API Management and Azure API Management 

Unfortunately, the testing functionality does not work because of the Cross-Origin Resource Sharing (CORS) policy. There is no standard way to handle CSRF tokens for modifying requests. 

 

TheValueChain’s solution: embedded Swagger UI 

None of the solutions mentioned can serve as both documentation and testing/validation tools for SAP NetWeaver Gateway services. The closest option is OpenAPI documentation with Swagger UI.  
 
However, at TheValueChain, we have developed a solution to overcome these limitations by creating an embedded Swagger UI in SAP. This tool supports both V2 and V4 OData services, automatically transforms metadata into OpenAPI JSON format, and allows functional analysts and users to generate interactive documentation and start testing and validating APIs. 

Want to know more about our custom UI solutions?  

 

Go to the SAP blog
d72ed8f9ad58cf5c397d778c063b2af4 kopie2 kopie.png

Want to know more?

Drop us a line and we'll be happy to catch up.