Skip to Content
Technical Articles

How to debug service layer, custom handlers – Cloud Application Programming Model

Github repository:

https://github.com/miltonchandradas/mymtaproject (Branch: part5)

 

Introduction:

  • In this session, we will look at how to debug the service layer by accessing the _req object
  • Also, we will look at how we can add more complex custom handlers

 

Synopsis:

  • The generic handlers serve most CRUD operations out-of-the-box
  • But to add custom logic, we have to provide our own custom handlers
  • Also, while developing complex custom handlers, we need a way to be able to debug and set breakpoints to access the values of variables at different lines

 

Steps:

  • In this example, we will explore the contents of the _req object in our custom handler
  • To understand the _req object, we will take an example where the end user needs to provide the password in a custom header in order to access a protected resource
  • We will set debug points in our code to look into the structure of the _req object and how we can access the custom header information
  • Then we will also add more custom code to compare the encrypted password with the password supplied by the user before returning the protected resource

 

YouTube link:

 

Conclusion:

  • This video should give you a clear idea on how to implement complex custom handlers in Cloud Application Programming Model
  • Also, the _req object is quite important when it comes to middleware functions.  You should now be comfortable with accessing, modifying the _req object to suit your needs
  • If you have any questions or comments, please list them below and I will be happy to answer

 

Next post:

https://blogs.sap.com/2020/08/23/how-to-implement-functions-cloud-application-programming-model/

 

Previous post:

https://blogs.sap.com/2020/08/23/how-to-implement-custom-handlers-cloud-application-programming-model/

Be the first to leave a comment
You must be Logged on to comment or reply to a post.