@Test public void parseSoapHeaderWithMultipleTPICHeader() throws SOAPException, JAXBException { final TpicMap tpicMap = TpicMap.wrap(Collections.singletonMap("FOooo", "Bar2")); final TpicMap tpicMap2 = TpicMap.wrap(Collections.singletonMap("FOooo2", "Bar3")); JAXBContext.newInstance(TpicMap.class).createMarshaller().marshal(tpicMap, soapMessage.getSOAPHeader()); JAXBContext.newInstance(TpicMap.class).createMarshaller().marshal(tpicMap2, soapMessage.getSOAPHeader()); final Map<String, String> parse = unit.parseSoapHeader(soapMessage.getSOAPHeader()); assertThat(parse, hasEntry("FOooo", "Bar2")); assertThat(parse, hasEntry("FOooo2", "Bar3")); }
public Map<String, String> parseSoapHeader(final Element soapHeader) { final NodeList tpicHeaders = soapHeader.getElementsByTagNameNS(TraceeConstants.SOAP_HEADER_NAMESPACE, TraceeConstants.TPIC_HEADER); final HashMap<String, String> contextMap = new HashMap<>(); if (tpicHeaders != null && tpicHeaders.getLength() > 0) { final int items = tpicHeaders.getLength(); for (int i = 0; i < items; i++) { contextMap.putAll(parseTpicHeader((Element) tpicHeaders.item(i))); } } return contextMap; }
SoapHeaderTransport { public Map<String, String> parseSoapHeader(final Element soapHeader) { final NodeList tpicHeaders = soapHeader.getElementsByTagNameNS(TraceeConstants.SOAP_HEADER_NAMESPACE, TraceeConstants.TPIC_HEADER); final HashMap<String, String> contextMap = new HashMap<>(); if (tpicHeaders != null && tpicHeaders.getLength() > 0) { final int items = tpicHeaders.getLength(); for (int i = 0; i < items; i++) { contextMap.putAll(parseTpicHeader((Element) tpicHeaders.item(i))); } } return contextMap; } }
SoapHeaderTransport { public Map<String, String> parseSoapHeader(final Element soapHeader) { final NodeList tpicHeaders = soapHeader.getElementsByTagNameNS(TraceeConstants.SOAP_HEADER_NAMESPACE, TraceeConstants.TPIC_HEADER); final HashMap<String, String> contextMap = new HashMap<>(); if (tpicHeaders != null && tpicHeaders.getLength() > 0) { final int items = tpicHeaders.getLength(); for (int i = 0; i < items; i++) { contextMap.putAll(parseTpicHeader((Element) tpicHeaders.item(i))); } } return contextMap; } SoapHeaderTransport(); }
SoapHeaderTransport { public Map<String, String> parseSoapHeader(final Element soapHeader) { final NodeList tpicHeaders = soapHeader.getElementsByTagNameNS(TraceeConstants.SOAP_HEADER_NAMESPACE, TraceeConstants.TPIC_HEADER); final HashMap<String, String> contextMap = new HashMap<>(); if (tpicHeaders != null && tpicHeaders.getLength() > 0) { final int items = tpicHeaders.getLength(); for (int i = 0; i < items; i++) { contextMap.putAll(parseTpicHeader((Element) tpicHeaders.item(i))); } } return contextMap; } SoapHeaderTransport(); Map<String, String> parseSoapHeader(final Element soapHeader); Map<String, String> parseTpicHeader(final Element element); Map<String, String> parseTpicHeader(final Source source); void renderSoapHeader(final Map<String, String> context, final SOAPHeader soapHeader); void renderSoapHeader(final Map<String, String> context, final Result result); }
SoapHeaderTransport { public Map<String, String> parseSoapHeader(final Element soapHeader) { final NodeList tpicHeaders = soapHeader.getElementsByTagNameNS(TraceeConstants.SOAP_HEADER_NAMESPACE, TraceeConstants.TPIC_HEADER); final HashMap<String, String> contextMap = new HashMap<>(); if (tpicHeaders != null && tpicHeaders.getLength() > 0) { final int items = tpicHeaders.getLength(); for (int i = 0; i < items; i++) { contextMap.putAll(parseTpicHeader((Element) tpicHeaders.item(i))); } } return contextMap; } SoapHeaderTransport(); Map<String, String> parseSoapHeader(final Element soapHeader); Map<String, String> parseTpicHeader(final Element element); Map<String, String> parseTpicHeader(final Source source); void renderSoapHeader(final Map<String, String> context, final SOAPHeader soapHeader); void renderSoapHeader(final Map<String, String> context, final Result result);  }