advanced rest client and sap gateway integrations - ETHIC CODER

0 downloads 153 Views 764KB Size Report
Mock up image. EXPLANATION OF MOCKUP IMAGE: 1 URL. Enter OData Service URL. 2 HTTP METHODS. Specify the method for which
ADVANCED REST CLIENT AND SAP GATEWAY INTEGRATIONS GUIDE BY PAVAN GOLESAR

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

TABLE OF CONTENTS What is REST ?........................................................................................................................................................ 3 Overview of REST Client.......................................................................................................................................... 4 Initial Setup of REST Client ...................................................................................................................................... 5 Launching Advanced Rest Client ............................................................................................................................. 6 Mock up image....................................................................................................................................................... 7 Explanation of Mockup Image ................................................................................................................................ 7 1 URL ................................................................................................................................. 7 2 Http Methods.................................................................................................................. 7 3 Header ............................................................................................................................ 7 4 Request Body .................................................................................................................. 7 Trouble shooting OData Services on SAP NetWeaver Gateway ................................................................................ 8 Error Log ............................................................................................................................ 8 Performance Trace ............................................................................................................. 8 Payload Trace..................................................................................................................... 8 Notification Monitor .......................................................................................................... 8 SAP Gateway Error with Solution ............................................................................................................................ 9 1. Error Message at Client .................................................................................................. 9 Error Analysis.................................................................................................................................................. 9 Common problems ......................................................................................................................................... 9 2. Error Message at client ................................................................................................... 9 Error Analysis.................................................................................................................................................. 9 Common Problems ......................................................................................................................................... 9 3. Error Message .............................................................................................................. 10 Error Analysis................................................................................................................................................ 10 Common problems ....................................................................................................................................... 10

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

What is REST ?



REST stands for Representational State Transfer. (It is sometimes spelled "ReST") is a simple stateless architecture.



It relies on a stateless, client-server, cacheable communications protocol -- and in virtually all cases, the HTTP protocol is used.



REST is an architecture style for designing networked applications.

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

Overview of REST Client & HTTP Methods

While working with SAP Gateway, You’ll mostly work with "Method", "Headers" and "Body" tabs. Choose the appropriate method on "Method" tab.

If you are using a GET method, then you don't need to use "Headers" or "Body" tab. If you are using a PUT or a POST, then put your XML in "Body" tab and add application/atom+xml (for Xml) and application/json (for Json) as "Content-Type" header on "Headers" tab. If you are trying to run a GET method followed by PUT or POST, you do not need to delete the contents of "Headers" and "Body" tabs. They will be promptly ignored.Don't forget to use "https" instead of "http".

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

Initial Setup of REST Client

First, download and install the REST Client from the following: 1. Go to Chrome Web Store or click here for path. 2. Search for Advance REST Client or click here for path. 3. Click on Advanced REST Client.

Click on Add to Chrome, a pop up of Add Advanced Rest client will appear:

Now Click on Add App to add Advance Rest Client Google Chrome Extensions.

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

LAUNCHING ADVANCED REST CLIENT

1. Click on app icon displaying on the header in Google Chrome. Type chrome://apps in chrome address bar(URL) or click as below

2. Now click on Advanced Rest Client Icon

While clicking on the Advanced Rest Client icon, user will be redirected to the landing page of Advanced Rest Client.

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

Mock up image

EXPLANATION OF MOCKU P IMAGE : 1 URL

Enter OData Service URL 2 HTTP METHODS

Specify the method for which they want to make an API call. For example: GET, PUT, POST, Delete Method 3 HEADER

Specify Basic Auth, X-CSRF Token (only for Put or POST) and Content Type (XML or Json).

4 REQUEST BODY

Enter Payload to be used for PUT, POST Operation.

NOTE: Don’t forget, we need to set up the authentication information. On "Auth" tab.

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

Trouble shooting OData Services on SAP NetWeaver Gateway ERROR LOG

Analyze errors that have occurred and led to a termination of an OData request or notification processing (push channel). 1. SAP NetWeaver Gateway hub system: transaction /IWFND/ERROR_LOG. 2. SAP Business Suite backend system: transaction /IWBEP/ERROR_LOG. Also you can use the Application Log Viewer to check more technical error details. 1. SAP NetWeaver Gateway hub system: transaction /IWFND_APPS_LOG. 2. SAP Business Suite backend system: transaction /IWBEP/VIEW_LOG. PERFORMANCE TRACE

Analyze performance problems relating to OData request processing. 1. SAP NetWeaver Gateway hub system: transaction /IWFND/TRACES. PAYLOAD TRACE

Monitor the flow of data sent as part of service requests and responses. 2. SAP NetWeaver Gateway hub system: transaction /IWFND/TRACES. NOTIFICATION MONITOR

Check and analyze notification processing in SAP Business Suite backend system or SAP NetWeaver Gateway hub system. 1. SAP NetWeaver Gateway hub system: transaction /IWFND/NOTIF_MONITOR. 2. SAP Business Suite backend system: transaction /IWBEP/NOTIF_MONITOR.

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

SAP Gateway Error with Solution 1. ERROR MESSAGE AT CLIENT

While calling a service operation through REST client, you encounter RFC call ended with "System Failure" exception” ERROR ANALYSIS

This is a very common error while using the RFC tool in Service Builder. There can be many reasons for this error and error can be pin pointed by looking at the back-end error log. One other option is to go to your Data Provider Class (DPC) and find the place where RFC is called and put external breakpoint and debug. COMMON PROBLEMS

Mandatory parameters are not supplied to RFC, Problem with RFC destination, Problem with the RFC itself (interface changed, not active etc.) 2. ERROR MESSAGE AT CLIENT

The specified HTTP method is not allowed for the resource identified by the Data Service Request URI ERROR ANALYSIS

For each http method you need to be aware of the right URI convention. COMMON PROBLEMS

For a ‘POST’ method URI should point to a Collection. Example: ….. /sap/opu/odata/// For a ‘PUT’ and ‘DELETE’ methods URI should point to an Entry. Example: ….. /sap/opu/odata///() If you are using a $batch, the request has to be a 'POST'

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

3. ERROR MESSAGE

While executing a query/read, encountered In the context of Data services and Unknown error occurred ERROR ANALYSIS

This is usually problem with the properties involving Date, Time, UoM etc. There seems to be problem with RFC model importer in Service Builder. COMMON PROBLEMS

If your RFC/model has a date property, check that it is of type Edm.DateTime and Precision is 0. Service Builder usually gives a Precision as 8. After changing it to 0, generate the runtime artifacts again, clear the cache and run the operation.

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]

LINKEDIN PROFILE

YOUTUBE CHANNEL

SAP PROFILE

SLIDE SHARE

MY BLOG

© abaper.weebly.com

| YouTube @ Ethic Coder |

[email protected]