cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Custom Errorhandling JSON REST SENDER Adapter

openrico
Participant
1,627

Hi,

I want to implement a custom errorhandling in my Rest Sender Adapter and couldn't find any solution to my problem.

I have the following requirement:


The Rest Adapter (Method Get) is called synchroniously. With an ICO I am getting data from ECC. In the Response payload there are either data from ecc or empty JSON Expressions. What i want to achive is, that if i have an empty Expression eg. PARTNER_ID, I want to respond with eg. HTTP Code 404.

With this Settings its not working.

my Json Looks like this:

{"MT_SELMA_OUTPUT": {
"PARTNER_ID": "" }}

Thank you for your help.

Greetings

Enrico

Accepted Solutions (1)

Accepted Solutions (1)

openrico
Participant
0 Kudos

Hi Rami,

yes i solved the problem. If you use "Convert to XML" in JSON Adapter you have to use "XPATH Expression" in Source. And then use the Xpath of your targetmassage.

Like in the picture in my particular Case.

I hope it helps you.

0 Kudos

Hi Enrico,

This was very helpful. In your example, you are checking if code = 404, were you able to check for code = ' ' using Xpath?

Thanks again.

openrico
Participant
0 Kudos

It should work, if you lieve "Expression (Glob)" empty.

Or you can define your code in Message Mapping like "XYZ" and search it in Custom error Handling and map an HTTP Status Code 404 to it.

Answers (1)

Answers (1)

0 Kudos

Do this Issue resolved?