protected void updateHeader(Exchange exchange, MessageContext ctx) { if (ctx.containsKey(Header.HEADER_LIST) && ctx.get(Header.HEADER_LIST) instanceof List<?>) { List<?> list = (List<?>) ctx.get(Header.HEADER_LIST); if (list != null && !list.isEmpty()) { SoapMessage sm = (SoapMessage) createResponseMessage(exchange); if (sm != null) { Iterator<?> iter = list.iterator(); while (iter.hasNext()) { Header header = (Header) iter.next(); if (header.getDirection() != Header.Direction.DIRECTION_IN && !header.getName().getNamespaceURI(). equals("http://docs.oasis-open.org/wss/2004/01/" + "oasis-200401-wss-wssecurity-secext-1.0.xsd") && !header.getName().getNamespaceURI(). equals("http://docs.oasis-open.org/" + "wss/oasis-wss-wssecurity-secext-1.1.xsd")) { //don't copy over security header, out interceptor chain will take care of it. sm.getHeaders().add(header); } } } } } }
public void handleMessage(SoapMessage message) throws Fault { Iterator<Header> iter = message.getHeaders().iterator(); while (iter.hasNext()) { Header hdr = iter.next(); //Only remove inbound marked headers.. if (hdr == null || hdr.getDirection() == Header.Direction.DIRECTION_IN) { iter.remove(); } } }
public void handleMessage(SoapMessage message) throws Fault { Iterator<Header> iter = message.getHeaders().iterator(); while (iter.hasNext()) { Header hdr = iter.next(); //Only remove inbound marked headers.. if (hdr == null || hdr.getDirection() == Header.Direction.DIRECTION_IN) { iter.remove(); } } }
protected void updateHeader(Exchange exchange, MessageContext ctx) { if (ctx.containsKey(Header.HEADER_LIST) && ctx.get(Header.HEADER_LIST) instanceof List<?>) { List<?> list = (List<?>) ctx.get(Header.HEADER_LIST); if (list != null && !list.isEmpty()) { SoapMessage sm = (SoapMessage) createResponseMessage(exchange); if (sm != null) { Iterator<?> iter = list.iterator(); while (iter.hasNext()) { Header header = (Header) iter.next(); if (header.getDirection() != Header.Direction.DIRECTION_IN && !header.getName().getNamespaceURI(). equals("http://docs.oasis-open.org/wss/2004/01/" + "oasis-200401-wss-wssecurity-secext-1.0.xsd") && !header.getName().getNamespaceURI(). equals("http://docs.oasis-open.org/" + "wss/oasis-wss-wssecurity-secext-1.1.xsd")) { //don't copy over security header, out interceptor chain will take care of it. sm.getHeaders().add(header); } } } } } }
public void handleMessage(SoapMessage soapMessage) throws Fault { SoapVersion soapVersion = soapMessage.getVersion(); Set<QName> notFound = new HashSet<>(); List<Header> heads = soapMessage.getHeaders(); for (Header header : heads) { if (header instanceof SoapHeader && ((SoapHeader)header).isMustUnderstand() && header.getDirection() == Header.Direction.DIRECTION_IN && !knownHeaders.contains(header.getName()) && (StringUtils.isEmpty(((SoapHeader)header).getActor()) || soapVersion.getUltimateReceiverRole() .equals(((SoapHeader)header).getActor()))) { notFound.add(header.getName()); } } if (!notFound.isEmpty()) { soapMessage.remove(UNKNOWNS); throw new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, notFound), soapVersion.getMustUnderstand()); } }
public void handleMessage(SoapMessage soapMessage) throws Fault { SoapVersion soapVersion = soapMessage.getVersion(); Set<QName> notFound = new HashSet<>(); List<Header> heads = soapMessage.getHeaders(); for (Header header : heads) { if (header instanceof SoapHeader && ((SoapHeader)header).isMustUnderstand() && header.getDirection() == Header.Direction.DIRECTION_IN && !knownHeaders.contains(header.getName()) && (StringUtils.isEmpty(((SoapHeader)header).getActor()) || soapVersion.getUltimateReceiverRole() .equals(((SoapHeader)header).getActor()))) { notFound.add(header.getName()); } } if (!notFound.isEmpty()) { soapMessage.remove(UNKNOWNS); throw new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, notFound), soapVersion.getMustUnderstand()); } }