public static void writeFlowId ( Message message , String flowId ) { if ( ! ( message instanceof SoapMessage ) ) { return ; } SoapMessage soapMessage = ( SoapMessage ) message ; Header hdFlowId = soapMessage . getHeader ( FLOW_ID_QNAME ) ; if ( hdFlowId != null ) { LOG . warning ( "FlowId already existing in soap header, need not to write FlowId header." ) ; return ; } try { soapMessage . getHeaders ( ) . add ( new Header ( FLOW_ID_QNAME , flowId , new JAXBDataBinding ( String . class ) ) ) ; if ( LOG . isLoggable ( Level . FINE ) ) { LOG . fine ( "Stored flowId '" + flowId + "' in soap header: " + FLOW_ID_QNAME ) ; } } catch ( JAXBException e ) { LOG . log ( Level . SEVERE , "Couldn't create flowId header." , e ) ; } }
Write flow id to message .