I have an out-interceptor which does
Message inMessage = soapMessage.getExchange().getInMessage();
MessageInfo messageInfo = inMessage.get( MessageInfo.class );
if ( null != messageInfo ) {
return messageInfo.getMessageParts()
.stream()
.filter( messagePartInfo -> headerTypeNames.contains(
messagePartInfo.getTypeQName().getNamespaceURI() ) )
.map( MessageContentsList.getContentsList( inMessage )::get )
.map( o -> HeaderAdapter.getInstance().map( o, EDBHeaderType.class ) )
.findFirst()
.orElseThrow( () -> new IllegalStateException( "Could not find
any header" ) );
which works fine when used in a standard http/servlet based deployment -
but when used with camel-cxf-transport the MessageInfo object does not
exist.
Is there any other nice way to get the marshalled header-object?
I can see that
List<SoapHeader> headerList = CastUtils.cast(
(List)soapMessage.getExchange().getInMessage().get( Header.HEADER_LIST
),
SoapHeader.class );
is a viable option - but is low-level as it deals with XML and qnames,
while this is already handled (since it's able to call my implementation
with the marshalled objects as arguments).
--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen