@Test public void renderBackendToSoapHeader() throws SOAPException { backend.put("my header", "Wow!"); unit.handleOutgoing(messageContext); final NodeList tpicElements = message.getSOAPHeader().getElementsByTagNameNS(TraceeConstants.SOAP_HEADER_NAMESPACE, TraceeConstants.TPIC_HEADER); assertThat(tpicElements.getLength(), is(1)); final Node tpicEntry = tpicElements.item(0).getChildNodes().item(0); assertThat(tpicEntry.getLocalName(), is("entry")); assertThat(tpicEntry.getAttributes().getNamedItem("key").getNodeValue(), is("my header")); assertThat(tpicEntry.getChildNodes().item(0).getNodeValue(), is("Wow!")); }
protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } TraceeClientHandler();  TraceeClientHandler(TraceeBackend traceeBackend); }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } TraceeClientHandler();  TraceeClientHandler(TraceeBackend traceeBackend); @Override final boolean handleFault(final SOAPMessageContext context); }
TraceeClientHandler extends AbstractTraceeHandler { protected final void handleOutgoing(final SOAPMessageContext context) { final SOAPMessage msg = context.getMessage(); if (msg != null && !traceeBackend.isEmpty() && traceeBackend.getConfiguration().shouldProcessContext(IncomingResponse)) { try { final SOAPHeader header = getOrCreateHeader(msg); final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(traceeBackend.copyToMap(), IncomingResponse); transportSerialization.renderSoapHeader(filteredContext, header); msg.saveChanges(); } catch (final SOAPException e) { logger.warn("TraceeClientHandler : Exception occurred during processing of outbound message.", e); } } } TraceeClientHandler();  TraceeClientHandler(TraceeBackend traceeBackend); @Override final boolean handleFault(final SOAPMessageContext context);  }