user3233451
user3233451

Reputation: 119

How to get instance of current message bein processed in cxf?

I want to get the ID of the Inbound message in my implemented service end point which has following parameters available:

  1. Custom JAXB Request
  2. @Context HttpServletRequest

    e.g. From below inbound message i want to retrieve ID: 1 in my service endpoint. INFO: Inbound Message

    ID: 1 Address: Encoding: ISO-8859-1 Http-Method: POST Content-Type: application/xml Headers: Payload:

Can anyone please tell me if there is a way to get that ID ?

Upvotes: 0

Views: 596

Answers (1)

Patrick
Patrick

Reputation: 2122

You can get the current CXF Message using PhaseInterceptorChain.getCurrentMessage(). The logging ID used by the logging interceptors is stored in the Message Map, and can be retrieved with its key, e.g.

String loggingId = (String) PhaseInterceptorChain.getCurrentMessage().get(LoggingMessage.ID_KEY);

Upvotes: 1

Related Questions