@SuppressWarnings("unchecked") public void handleMessage(SoapMessage soapMessage) throws Fault { Map<String, Object> headers = (Map<String, Object>)soapMessage.get(Message.PROTOCOL_HEADERS); if (headers != null && headers.containsKey(SoapBindingConstants.SOAP_ACTION)) { //need to flip to a case sensitive map. The default //is a case insensitive map, but in this case, we need //to use a case sensitive map to make sure both versions go out headers = new TreeMap<>(headers); soapMessage.put(Message.PROTOCOL_HEADERS, headers); headers.put(SOAPACTION_TIBCO, headers.get(SoapBindingConstants.SOAP_ACTION)); } }
@Override public void handleFault(SoapMessage msg) { Set<QName> unknowns = CastUtils.cast((Set<?>)msg.get(MustUnderstandInterceptor.UNKNOWNS)); if (msg.getExchange().getBindingOperationInfo() == null && unknowns != null && !unknowns.isEmpty()) { //per jaxws spec, if there are must understands that we didn't understand, but couldn't map //to an operation either, we need to throw the mustunderstand fault, not the one related to //an unknown operation msg.setContent(Exception.class, new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, unknowns), msg.getVersion().getMustUnderstand())); } }
@Override public void handleFault(SoapMessage msg) { Set<QName> unknowns = CastUtils.cast((Set<?>)msg.get(MustUnderstandInterceptor.UNKNOWNS)); if (msg.getExchange().getBindingOperationInfo() == null && unknowns != null && !unknowns.isEmpty()) { //per jaxws spec, if there are must understands that we didn't understand, but couldn't map //to an operation either, we need to throw the mustunderstand fault, not the one related to //an unknown operation msg.setContent(Exception.class, new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, unknowns), msg.getVersion().getMustUnderstand())); } }
public List<Header> getHeaders() { List<Header> heads = CastUtils.cast((List<?>)get(Header.HEADER_LIST)); if (heads == null) { heads = new ArrayList<>(); put(Header.HEADER_LIST, heads); } return heads; }
public List<Header> getHeaders() { List<Header> heads = CastUtils.cast((List<?>)get(Header.HEADER_LIST)); if (heads == null) { heads = new ArrayList<>(); put(Header.HEADER_LIST, heads); } return heads; }
public void handleMessage(SoapMessage msg) throws Fault { AssertionInfoMap aim = msg.get(AssertionInfoMap.class); boolean enableStax = MessageUtils.getContextualBoolean(msg, SecurityConstants.ENABLE_STREAMING_SECURITY); if (aim != null && enableStax) { super.handleMessage(msg); } }
public void handleMessage(SoapMessage message) throws Fault { String s = (String)message.get(SoapBindingConstants.SOAP_ACTION); if (s == null) { s = SoapActionInInterceptor.getSoapAction(message); } handleMessageForAction(message, s, aim, ais); } };
public void handleMessage(SoapMessage message) throws Fault { String s = (String)message.get(SoapBindingConstants.SOAP_ACTION); if (s == null) { s = SoapActionInInterceptor.getSoapAction(message); } handleMessageForAction(message, s, aim, ais); } };
public void handleMessage(SoapMessage msg) throws Fault { AssertionInfoMap aim = msg.get(AssertionInfoMap.class); boolean enableStax = MessageUtils.getContextualBoolean(msg, SecurityConstants.ENABLE_STREAMING_SECURITY); if (aim != null && enableStax) { super.handleMessage(msg); } }
public void handleMessage(SoapMessage msg) throws Fault { AssertionInfoMap aim = msg.get(AssertionInfoMap.class); boolean enableStax = MessageUtils.getContextualBoolean(msg, SecurityConstants.ENABLE_STREAMING_SECURITY); if (aim != null && !enableStax) { super.handleMessage(msg); } }
private String getAction(SoapMessage msg, SoapVersion version) { String action = (String)getOption(ConfigurationConstants.ACTION); if (action == null) { action = (String)msg.get(ConfigurationConstants.ACTION); } if (action == null && !ignoreActions) { LOG.warning("No security action was defined!"); throw new SoapFault("No security action was defined!", version.getReceiver()); } return action; }
protected Wss10 getWss10() { AssertionInfoMap aim = message.get(AssertionInfoMap.class); AssertionInfo ai = PolicyUtils.getFirstAssertionByLocalname(aim, SPConstants.WSS10); if (ai == null) { ai = PolicyUtils.getFirstAssertionByLocalname(aim, SPConstants.WSS11); } if (ai != null) { return (Wss10)ai.getAssertion(); } return null; }
protected AbstractToken assertTokens(SoapMessage message) { AssertionInfoMap aim = message.get(AssertionInfoMap.class); PolicyUtils.assertPolicy(aim, "WssKerberosV5ApReqToken11"); PolicyUtils.assertPolicy(aim, "WssGssKerberosV5ApReqToken11"); return assertTokens(message, SPConstants.KERBEROS_TOKEN, false); }
protected AbstractToken assertTokens(SoapMessage message) { AssertionInfoMap aim = message.get(AssertionInfoMap.class); PolicyUtils.assertPolicy(aim, "WssKerberosV5ApReqToken11"); PolicyUtils.assertPolicy(aim, "WssGssKerberosV5ApReqToken11"); return assertTokens(message, SPConstants.KERBEROS_TOKEN, false); }
protected AbstractToken assertTokens(SoapMessage message) { AssertionInfoMap aim = message.get(AssertionInfoMap.class); PolicyUtils.assertPolicy(aim, "WssSamlV11Token10"); PolicyUtils.assertPolicy(aim, "WssSamlV11Token11"); PolicyUtils.assertPolicy(aim, "WssSamlV20Token11"); return assertTokens(message, SPConstants.SAML_TOKEN, true); }
protected AbstractToken assertTokens(SoapMessage message) { AssertionInfoMap aim = message.get(AssertionInfoMap.class); PolicyUtils.assertPolicy(aim, "WssSamlV11Token10"); PolicyUtils.assertPolicy(aim, "WssSamlV11Token11"); PolicyUtils.assertPolicy(aim, "WssSamlV20Token11"); return assertTokens(message, SPConstants.SAML_TOKEN, true); }
@Override public void handleFault(SoapMessage message) { super.handleFault(message); //need to clear these so the fault writing will work correctly message.removeContent(SOAPMessage.class); message.remove(SoapOutInterceptor.WROTE_ENVELOPE_START); XMLStreamWriter writer = (XMLStreamWriter)message.get(ORIGINAL_XML_WRITER); if (writer != null) { message.setContent(XMLStreamWriter.class, writer); message.remove(ORIGINAL_XML_WRITER); } }
public void handleMessage(SoapMessage message) throws Fault { Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>)message .get(Message.PROTOCOL_HEADERS)); if (headers != null) { checkContentType(message, headers); checkContentEncoding(message, headers); checkRequestURI(message, headers); checkSoapAction(message, headers); checkBindingVersion(message, headers); checkJMSMessageFormat(message, headers); } }
protected UsernameToken assertTokens(SoapMessage message) { AssertionInfoMap aim = message.get(AssertionInfoMap.class); PolicyUtils.assertPolicy(aim, SPConstants.USERNAME_TOKEN10); PolicyUtils.assertPolicy(aim, SPConstants.USERNAME_TOKEN11); PolicyUtils.assertPolicy(aim, SPConstants.HASH_PASSWORD); PolicyUtils.assertPolicy(aim, SPConstants.NO_PASSWORD); PolicyUtils.assertPolicy(aim, SP13Constants.NONCE); PolicyUtils.assertPolicy(aim, SP13Constants.CREATED); return (UsernameToken)assertTokens(message, SPConstants.USERNAME_TOKEN, true); }
private boolean isIncomingPartialResponse(SoapMessage message) throws SOAPException { AddressingProperties maps = (AddressingProperties)message.get(ADDRESSING_PROPERTIES_INBOUND); return !ContextUtils.isOutbound(message) && ContextUtils.isRequestor(message) && maps != null && Names.WSA_ANONYMOUS_ADDRESS.equals(maps.getTo().getValue()); }