cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Karlsen <davidkarl...@gmail.com>
Subject Getting the marshalled soapheaders when using camel cxftransport
Date Fri, 05 Aug 2016 17:47:17 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message