cancel
Showing results for 
Search instead for 
Did you mean: 

B1if Integration framework 2.0: HTTP Call Error managment

fabio_ubbiali
Explorer

Dear SAP and B1if Experts,

I'm trying to make some POST calls to some service layers but I'm having some difficulties especially with error handling (see also my other post).

Below is part of my scenario with the problematic atoms. The goal is to have:

  • One trasformation atom
  • One HTTP Call adapter

1. HTTP POST CALL using HTTA adapter

A) adjustToSmartMsg set false

Passing the values in the transformation atom (beas-preparetimereceipt.xml) the result is:

  • HTTP Status=200 --> everything works fine
  • HTTP Status=400/401 --> the step caught an exception. How could I get the response back in the payload? I also tried to manage the step using an Error Step but it does not return the correct body

B) adjustToSmartMsg set true

It doesn't seem to read the cookie because it returns 401 unauthorized. It still goes into exception.

2. HTTP POST CALL using HTTA.1 adapter

Passing the values and the configurations in the transformation atom (beas-preparetimereceipt-v1.xml) the result is:

  • The call returns a generic layer error, as if the payload is not formed correctly (Below the correct payload set in POSTMAN). Is the payload in the transformation atom formatted correctly?
{"DocEntry":220034,
   "LineNumber":10,"LineNumber2":10,
   "LineNumber3":0,
   "TimeType":"A",
   "QuantityGood": 1, 
   "PersonnelId": "1",    
   "QuantityScrap":0,
   "StartDate": "2022/04/04",
   "EndDate": "2022/04/04",
   "StartTime":"00:00",
   "EndTime":"00:00",
   "Trial": 15,
   "CloseEntry":false,     
   "ManualBooking":false,   
   "Duration": 60,
   "CalculateDuration":false, 
   "Remarks": "Test 3"
}
  • Having set Stop processing if fails=false the error returns correctly in the payload

Basically I need to have the correct error returned within my payload so I can use it to send an email or do something else.

  • HTTA Adapter: how can I set Stop processing if fails=false?
  • HTTA.1 Adapter: What's wrong in my payload?

Thanks a lot

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

Hi Fabio,

Setting the highlighted properties on the HTTA Outbound Configuration worked for me. You can try it and see if it gives you the desired response in the event that there's an error when making the call.

Regards,

Wilson Wambugu

fabio_ubbiali
Explorer
0 Kudos

Great, it works!

Point 1A has been solved with Wilson's answer. Thanks Wilson.

Point 2 has been solved with this community post.

It is still open the point 1B. its payload is the following but it always returns unauthorized.

Fabio

Answers (0)