4

I have created my own MediatorClass. Which has this major method:

public boolean mediate(MessageContext context) { 
    // TODO Implement your mediation logic here
    return true;
}

Now there is a problem. This mediator is part of REST API sequence which has Text body that I want to edit.

How it's possible to extract this Payload as String?

Community
  • 1
  • 1
Mr.D
  • 7,353
  • 13
  • 60
  • 119

1 Answers1

1

Get the root element of the soap body :

OMElement element = (OMElement) context.getEnvelope().getBody().getFirstOMChild();

(see MessageContext)

Just use element.toString() (see OMElement)

Jean-Michel
  • 5,926
  • 1
  • 13
  • 19