@Override public void handleMessage(SoapMessage message) throws Fault { HttpServletResponse response = (HttpServletResponse) message.getExchange() .getInMessage().get(AbstractHTTPDestination.HTTP_RESPONSE); response.setStatus(200); // message.put(SoapMessage.RESPONSE_CODE, 200); } }
private void validateFault(SoapMessage message, SOAPFault fault, BindingOperationInfo bop) { if (ServiceUtils.isSchemaValidationEnabled(SchemaValidationType.OUT, message)) { Schema schema = EndpointReferenceUtils.getSchema(message.getExchange().getService() .getServiceInfos().get(0), message.getExchange().getBus()); Detail d = fault.getDetail(); try { validateFaultDetail(d, schema, bop); } catch (Exception e) { throw new SoapFault(e.getMessage(), e, message.getVersion().getReceiver()); } //We validated what we can from a fault standpoint message.put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.FALSE); } }
message.getInterceptorChain().abort(); MessageObserver observer = message.getExchange().get(MessageObserver.class); if (!message.getExchange().isOneWay() && observer != null) { Endpoint e = message.getExchange().getEndpoint(); Message responseMsg = new MessageImpl(); responseMsg.setExchange(message.getExchange()); responseMsg = e.getBinding().createMessage(responseMsg); message.getExchange().setInMessage(responseMsg); SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage(); Endpoint e = message.getExchange().getEndpoint(); if (!message.getExchange().isOneWay()) { Message responseMsg = new MessageImpl(); responseMsg.setExchange(message.getExchange()); responseMsg = e.getBinding().createMessage(responseMsg); message.getExchange().setOutMessage(responseMsg); SOAPMessage soapMessage = ((SOAPMessageContext)context).getMessage(); .getExchange()); responseMsg.setInterceptorChain(chain);
SOAPMessageContextImpl sm = new SOAPMessageContextImpl(message); Exchange exch = message.getExchange(); setupBindingOperationInfo(exch, sm); SOAPMessage msg = sm.getMessage();
public void handleMessage(SoapMessage message) throws Fault { BindingOperationInfo bop = message.getExchange().getBindingOperationInfo(); if (bop == null) { return;
public void handleMessage(SoapMessage message) throws Fault { Exchange ex = message.getExchange(); BindingOperationInfo bop = ex.getBindingOperationInfo(); if (bop == null) { return; } if (bop.isUnwrapped()) { bop = bop.getWrappedOperation(); } boolean client = isRequestor(message); BindingMessageInfo bmi = client ? bop.getInput() : bop.getOutput(); if (bmi == null) { return; } SoapBodyInfo sbi = bmi.getExtensor(SoapBodyInfo.class); if (sbi == null || sbi.getAttachments() == null || sbi.getAttachments().isEmpty()) { Service s = ex.getService(); DataBinding db = s.getDataBinding(); if (db instanceof JAXBDataBinding && hasSwaRef((JAXBDataBinding) db)) { setupAttachmentOutput(message); } return; } processAttachments(message, sbi); } protected void processAttachments(SoapMessage message, SoapBodyInfo sbi) {
Endpoint ep = message.getExchange().getEndpoint(); message.getInterceptorChain().abort(); if (ep.getInFaultObserver() != null) {
BindingOperationInfo bop = message.getExchange().getBindingOperationInfo(); DocumentFragment frag = soapMessage.getSOAPPart().createDocumentFragment(); try { message.getExchange().put(BindingOperationInfo.class, bop);
/** * Cache exchange for correlated response * * @param message the current message * @param maps the addressing properties */ private void cacheExchange(SoapMessage message, AddressingProperties maps) { if (ContextUtils.isRequestor(message) && !message.getExchange().isOneWay()) { uncorrelatedExchanges.put(maps.getMessageID().getValue(), message.getExchange()); } }
/** * Cache exchange for correlated response * * @param message the current message * @param maps the addressing properties */ private void cacheExchange(SoapMessage message, AddressingProperties maps) { if (ContextUtils.isRequestor(message) && !message.getExchange().isOneWay()) { uncorrelatedExchanges.put(maps.getMessageID().getValue(), message.getExchange()); } }
@Override public void handleMessage(SoapMessage message) throws Fault { Exchange exchange = message.getExchange(); if (strategy.isRejected(exchange)) { strategy.handleRejectedExchange(exchange); } } }
/** * Sets a new call context map. */ protected void setCallContextMap(SoapMessage message, Map<String, String> callContextMap) { message.getExchange().getInMessage().put(AbstractService.CALL_CONTEXT_MAP, callContextMap); }
@Override protected List<SecurityEventListener> configureSecurityEventListeners( SoapMessage msg, WSSSecurityProperties securityProperties ) throws WSSPolicyException { final List<SecurityEventListener> securityEventListeners = new ArrayList<>(2); securityEventListeners.addAll(super.configureSecurityEventListeners(msg, securityProperties)); Endpoint endoint = msg.getExchange().getEndpoint(); PolicyEnforcer policyEnforcer = createPolicyEnforcer(endoint.getEndpointInfo(), msg); securityProperties.addInputProcessor(new PolicyInputProcessor(policyEnforcer, securityProperties)); securityEventListeners.add(policyEnforcer); return securityEventListeners; }
@Override public Object getProperty(Object msgContext, String key) { // use the superclass first Object result = super.getProperty(msgContext, key); // handle the special case of the RECV_RESULTS if (result == null && WSHandlerConstants.RECV_RESULTS.equals(key) && !this.isRequestor((SoapMessage)msgContext)) { result = ((SoapMessage)msgContext).getExchange().getInMessage().get(key); } return result; }
@Override public Object getProperty(Object msgContext, String key) { // use the superclass first Object result = super.getProperty(msgContext, key); // handle the special case of the RECV_RESULTS if (result == null && WSHandlerConstants.RECV_RESULTS.equals(key) && !this.isRequestor((SoapMessage)msgContext)) { result = ((SoapMessage)msgContext).getExchange().getInMessage().get(key); } return result; }
@Override protected List<SecurityEventListener> configureSecurityEventListeners( SoapMessage msg, WSSSecurityProperties securityProperties ) throws WSSPolicyException { final List<SecurityEventListener> securityEventListeners = new ArrayList<>(2); securityEventListeners.addAll(super.configureSecurityEventListeners(msg, securityProperties)); Endpoint endoint = msg.getExchange().getEndpoint(); PolicyEnforcer policyEnforcer = createPolicyEnforcer(endoint.getEndpointInfo(), msg); securityProperties.addInputProcessor(new PolicyInputProcessor(policyEnforcer, securityProperties)); securityEventListeners.add(policyEnforcer); return securityEventListeners; }
protected TokenStore getTokenStore(SoapMessage message) { EndpointInfo info = message.getExchange().getEndpoint().getEndpointInfo(); synchronized (info) { TokenStore tokenStore = (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE); if (tokenStore == null) { tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE); } return tokenStore; } }
protected TokenStore getTokenStore(SoapMessage message) { EndpointInfo info = message.getExchange().getEndpoint().getEndpointInfo(); synchronized (info) { TokenStore tokenStore = (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE); if (tokenStore == null) { tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE); } return tokenStore; } }
@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())); } }