How to extract web service operation name from camel exchange ?

Solution Verified - Updated -

Issue

  • We have a requirement to extract web service operation name from camel exchange, this will be used for authorization purpose. We are using simple HTTP proxying, so that we can not use regular way like proxying using POJO, PAYLOAD or MESSAGE format(with CXF or JAX-WS), overall, we cannot get the payload or operation name with the easy way provided.

  • We tried to extract the SOAPMessage from exchange using following code.

public void process(Exchange exchange) {
        SOAPMessage soapMessage = (SOAPMessage)exchange.getIn().getBody(List.class).get(0);
.............
}

but the result is always null, stack trace show s that the body is a cache stream object.

  • Would you please help to provide a code snapshot to extract the SOAPMessage and get operation name ?
  • We expect the way to get the operation name be general, so that it can process webservice request from different client e.g. Axis or CXF etc.

Environment

  • Red Hat JBoss Fuse
    • 6.x
  • camel-cxf component

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content