@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { initEndpointAdapters(applicationContext); initEndpointExceptionResolvers(applicationContext); initEndpointMappings(applicationContext); }
try { mappedEndpoint = getEndpoint(messageContext); if (mappedEndpoint == null || mappedEndpoint.getEndpoint() == null) { throw new NoEndpointFoundException(messageContext.getRequest()); if (!handleRequest(mappedEndpoint, messageContext)) { return; interceptorIndex = i; if (!interceptor.handleRequest(messageContext, mappedEndpoint.getEndpoint())) { triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, null); return; EndpointAdapter endpointAdapter = getEndpointAdapter(mappedEndpoint.getEndpoint()); endpointAdapter.invoke(messageContext, mappedEndpoint.getEndpoint()); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); processEndpointException(messageContext, endpoint, ex); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, null); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, ex); throw ex;
requestContent = getMessageContent(messageContext.getRequest()); receivedMessageTracingLogger.debug("Received request [" + messageContext.getRequest() + "]"); dispatch(messageContext); if (messageContext.hasResponse()) { WebServiceMessage response = messageContext.getResponse(); if (sentMessageTracingLogger.isTraceEnabled()) { String responseContent = getMessageContent(response); sentMessageTracingLogger.trace("Sent response [" + responseContent + "] for request [" + requestContent + "]");
/** * Returns the {@code EndpointAdapter} for the given endpoint. * * @param endpoint the endpoint to find an adapter for * @return the adapter */ protected EndpointAdapter getEndpointAdapter(Object endpoint) { for (EndpointAdapter endpointAdapter : getEndpointAdapters()) { if (logger.isDebugEnabled()) { logger.debug("Testing endpoint adapter [" + endpointAdapter + "]"); } if (endpointAdapter.supports(endpoint)) { return endpointAdapter; } } throw new IllegalStateException("No adapter for endpoint [" + endpoint + "]: Is your endpoint annotated with " + "@Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?"); }
/** * Returns the endpoint for this request. All endpoint mappings are tried, in order. * * @return the {@code EndpointInvocationChain}, or {@code null} if no endpoint could be found. */ protected EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception { for (EndpointMapping endpointMapping : getEndpointMappings()) { EndpointInvocationChain endpoint = endpointMapping.getEndpoint(messageContext); if (endpoint != null) { if (logger.isDebugEnabled()) { logger.debug("Endpoint mapping [" + endpointMapping + "] maps request to endpoint [" + endpoint.getEndpoint() + "]"); } return endpoint; } else if (logger.isDebugEnabled()) { logger.debug("Endpoint mapping [" + endpointMapping + "] has no mapping for request"); } } return null; }
/** * Determine an error {@code SOAPMessage} response via the registered {@code EndpointExceptionResolvers}. * Most likely, the response contains a {@code SOAPFault}. If no suitable resolver was found, the exception is * rethrown. * * @param messageContext current SOAPMessage request * @param endpoint the executed endpoint, or null if none chosen at the time of the exception * @param ex the exception that got thrown during handler execution * @throws Exception if no suitable resolver is found */ protected void processEndpointException(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { if (!CollectionUtils.isEmpty(getEndpointExceptionResolvers())) { for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) { if (resolver.resolveException(messageContext, endpoint, ex)) { if (logger.isDebugEnabled()) { logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex); } return; } } } // exception not resolved throw ex; }
try { mappedEndpoint = getEndpoint(messageContext); if (mappedEndpoint == null || mappedEndpoint.getEndpoint() == null) { throw new NoEndpointFoundException(messageContext.getRequest()); if (!handleRequest(mappedEndpoint, messageContext)) { return; interceptorIndex = i; if (!interceptor.handleRequest(messageContext, mappedEndpoint.getEndpoint())) { triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, null); return; EndpointAdapter endpointAdapter = getEndpointAdapter(mappedEndpoint.getEndpoint()); endpointAdapter.invoke(messageContext, mappedEndpoint.getEndpoint()); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); processEndpointException(messageContext, endpoint, ex); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, null); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, ex); throw ex;
requestContent = getMessageContent(messageContext.getRequest()); receivedMessageTracingLogger.debug("Received request [" + messageContext.getRequest() + "]"); dispatch(messageContext); if (messageContext.hasResponse()) { WebServiceMessage response = messageContext.getResponse(); if (sentMessageTracingLogger.isTraceEnabled()) { String responseContent = getMessageContent(response); sentMessageTracingLogger.trace("Sent response [" + responseContent + "] for request [" + requestContent + "]");
/** * Returns the <code>EndpointAdapter</code> for the given endpoint. * * @param endpoint the endpoint to find an adapter for * @return the adapter */ protected EndpointAdapter getEndpointAdapter(Object endpoint) { for (EndpointAdapter endpointAdapter : getEndpointAdapters()) { if (logger.isDebugEnabled()) { logger.debug("Testing endpoint adapter [" + endpointAdapter + "]"); } if (endpointAdapter.supports(endpoint)) { return endpointAdapter; } } throw new IllegalStateException("No adapter for endpoint [" + endpoint + "]: Is your endpoint annotated with " + "@Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?"); }
/** * Returns the endpoint for this request. All endpoint mappings are tried, in order. * * @return the {@code EndpointInvocationChain}, or {@code null} if no endpoint could be found. */ protected EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception { for (EndpointMapping endpointMapping : getEndpointMappings()) { EndpointInvocationChain endpoint = endpointMapping.getEndpoint(messageContext); if (endpoint != null) { if (logger.isDebugEnabled()) { logger.debug("Endpoint mapping [" + endpointMapping + "] maps request to endpoint [" + endpoint.getEndpoint() + "]"); } return endpoint; } else if (logger.isDebugEnabled()) { logger.debug("Endpoint mapping [" + endpointMapping + "] has no mapping for request"); } } return null; }
/** * Determine an error {@code SOAPMessage} response via the registered {@code EndpointExceptionResolvers}. * Most likely, the response contains a {@code SOAPFault}. If no suitable resolver was found, the exception is * rethrown. * * @param messageContext current SOAPMessage request * @param endpoint the executed endpoint, or null if none chosen at the time of the exception * @param ex the exception that got thrown during handler execution * @throws Exception if no suitable resolver is found */ protected void processEndpointException(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { if (!CollectionUtils.isEmpty(getEndpointExceptionResolvers())) { for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) { if (resolver.resolveException(messageContext, endpoint, ex)) { if (logger.isDebugEnabled()) { logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex); } return; } } } // exception not resolved throw ex; }
try { mappedEndpoint = getEndpoint(messageContext); if (mappedEndpoint == null || mappedEndpoint.getEndpoint() == null) { throw new NoEndpointFoundException(messageContext.getRequest()); if (!handleRequest(mappedEndpoint, messageContext)) { return; interceptorIndex = i; if (!interceptor.handleRequest(messageContext, mappedEndpoint.getEndpoint())) { triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, null); return; EndpointAdapter endpointAdapter = getEndpointAdapter(mappedEndpoint.getEndpoint()); endpointAdapter.invoke(messageContext, mappedEndpoint.getEndpoint()); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); processEndpointException(messageContext, endpoint, ex); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, null); triggerAfterCompletion(mappedEndpoint, interceptorIndex, messageContext, ex); throw ex;
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { initEndpointAdapters(applicationContext); initEndpointExceptionResolvers(applicationContext); initEndpointMappings(applicationContext); }
requestContent = getMessageContent(messageContext.getRequest()); receivedMessageTracingLogger.debug("Received request [" + messageContext.getRequest() + "]"); dispatch(messageContext); if (messageContext.hasResponse()) { WebServiceMessage response = messageContext.getResponse(); if (sentMessageTracingLogger.isTraceEnabled()) { String responseContent = getMessageContent(response); sentMessageTracingLogger.trace("Sent response [" + responseContent + "] for request [" + requestContent + "]");
/** * Returns the {@code EndpointAdapter} for the given endpoint. * * @param endpoint the endpoint to find an adapter for * @return the adapter */ protected EndpointAdapter getEndpointAdapter(Object endpoint) { for (EndpointAdapter endpointAdapter : getEndpointAdapters()) { if (logger.isDebugEnabled()) { logger.debug("Testing endpoint adapter [" + endpointAdapter + "]"); } if (endpointAdapter.supports(endpoint)) { return endpointAdapter; } } throw new IllegalStateException("No adapter for endpoint [" + endpoint + "]: Is your endpoint annotated with " + "@Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?"); }
/** * Returns the endpoint for this request. All endpoint mappings are tried, in order. * * @return the {@code EndpointInvocationChain}, or {@code null} if no endpoint could be found. */ protected EndpointInvocationChain getEndpoint(MessageContext messageContext) throws Exception { for (EndpointMapping endpointMapping : getEndpointMappings()) { EndpointInvocationChain endpoint = endpointMapping.getEndpoint(messageContext); if (endpoint != null) { if (logger.isDebugEnabled()) { logger.debug("Endpoint mapping [" + endpointMapping + "] maps request to endpoint [" + endpoint.getEndpoint() + "]"); } return endpoint; } else if (logger.isDebugEnabled()) { logger.debug("Endpoint mapping [" + endpointMapping + "] has no mapping for request"); } } return null; }
/** * Determine an error {@code SOAPMessage} response via the registered {@code EndpointExceptionResolvers}. * Most likely, the response contains a {@code SOAPFault}. If no suitable resolver was found, the exception is * rethrown. * * @param messageContext current SOAPMessage request * @param endpoint the executed endpoint, or null if none chosen at the time of the exception * @param ex the exception that got thrown during handler execution * @throws Exception if no suitable resolver is found */ protected void processEndpointException(MessageContext messageContext, Object endpoint, Exception ex) throws Exception { if (!CollectionUtils.isEmpty(getEndpointExceptionResolvers())) { for (EndpointExceptionResolver resolver : getEndpointExceptionResolvers()) { if (resolver.resolveException(messageContext, endpoint, ex)) { if (logger.isDebugEnabled()) { logger.debug("Endpoint invocation resulted in exception - responding with Fault", ex); } return; } } } // exception not resolved throw ex; }
try { mappedEndpoint = getEndpoint(messageContext); if (mappedEndpoint == null || mappedEndpoint.getEndpoint() == null) { throw new NoEndpointFoundException(messageContext.getRequest()); if (!handleRequest(mappedEndpoint, messageContext)) { return; interceptorIndex = i; if (!interceptor.handleRequest(messageContext, mappedEndpoint.getEndpoint())) { triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); return; EndpointAdapter endpointAdapter = getEndpointAdapter(mappedEndpoint.getEndpoint()); endpointAdapter.invoke(messageContext, mappedEndpoint.getEndpoint()); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext); processEndpointException(messageContext, endpoint, ex); triggerHandleResponse(mappedEndpoint, interceptorIndex, messageContext);
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { initEndpointAdapters(applicationContext); initEndpointExceptionResolvers(applicationContext); initEndpointMappings(applicationContext); }
requestContent = getMessageContent(messageContext.getRequest()); receivedMessageTracingLogger.debug("Received request [" + messageContext.getRequest() + "]"); dispatch(messageContext); if (messageContext.hasResponse()) { WebServiceMessage response = messageContext.getResponse(); if (sentMessageTracingLogger.isTraceEnabled()) { String responseContent = getMessageContent(response); sentMessageTracingLogger.trace("Sent response [" + responseContent + "] for request [" + requestContent + "]");