rishi puri
rishi puri

Reputation: 1

Need to Pass payload from WSO2 APIM to Java Mediate function

I referred the following stack overflow link How to encrypt response payload

As well, I referred the below github link which is shared as 2nd solution in above stack overflow link. https://github.com/yasassri/wso2-aes-mediator

But I am unable to pass payload from wso2 APIM to Java mediate function. I tried mutilple ways for passing the payload using attached OutSeq.xml file as policy in APIM. I tried passing paylaod outside class mediator as well as inside class mediator , even I tried hardcoding the values in java file AESEncryptMediator.java but nothing is working.

Please refer attached xml file that I used to pass payload from APIM to Java Mediate function defined within AESEncryptMediator.java Please Provide the Solution to pass the payload from APIM to Mediate function and read the encrypted/decrypted payload back to APIM

.enter image description here

I tried mutilple ways for passing the payload using attached OutSeq.xml file as policy in APIM. I tried passing paylaod outside class mediator as well as inside class mediator , even I tried hardcoding the values in java file AESEncryptMediator.java but nothing is working.

Please refer attached xml file that I used to pass payload from APIM to Java Mediate function defined within AESEncryptMediator.java Please Provide the Solution to pass the payload from APIM to Mediate function and read the encrypted/decrypted payload back to APIM

Upvotes: 0

Views: 54

Answers (1)

ycr
ycr

Reputation: 14604

As per the implementation of the class mediator, you need to pass the property name not the payload. So first assign the payload to a property and then pass the name of the property to the class mediator.

Upvotes: 0

Related Questions