@Override protected InputStream getRequestInputStream() throws IOException { return getHttpServletRequest().getInputStream(); }
@Override public void onClose() throws IOException { if (!statusCodeSet) { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_ACCEPTED); } }
/** * If Http status code is set on reply message headers simulate Http error with status code. * No SOAP response is sent back in this case. * @param replyMessage * @return * @throws IOException */ private boolean simulateHttpStatusCode(Message replyMessage) throws IOException { if (replyMessage == null || CollectionUtils.isEmpty(replyMessage.getHeaders())) { return false; } for (Entry<String, Object> headerEntry : replyMessage.getHeaders().entrySet()) { if (headerEntry.getKey().equalsIgnoreCase(SoapMessageHeaders.HTTP_STATUS_CODE)) { WebServiceConnection connection = TransportContextHolder.getTransportContext().getConnection(); int statusCode = Integer.valueOf(headerEntry.getValue().toString()); if (connection instanceof HttpServletConnection) { ((HttpServletConnection)connection).setFault(false); ((HttpServletConnection)connection).getHttpServletResponse().setStatus(statusCode); return true; } else { log.warn("Unable to set custom Http status code on connection other than HttpServletConnection (" + connection.getClass().getName() + ")"); } } } return false; }
public ModelAndView handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception { if (HttpTransportConstants.METHOD_POST.equals(httpServletRequest.getMethod())) { WebServiceConnection connection = new HttpServletConnection(httpServletRequest, httpServletResponse); handleConnection(connection, (WebServiceMessageReceiver) handler); } else { httpServletResponse.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); } return null; }
@Override public ModelAndView handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception { if (HttpTransportConstants.METHOD_POST.equals(httpServletRequest.getMethod())) { WebServiceConnection connection = new HttpServletConnection(httpServletRequest, httpServletResponse); try { handleConnection(connection, (WebServiceMessageReceiver) handler); } catch (InvalidXmlException ex) { handleInvalidXmlException(httpServletRequest, httpServletResponse, handler, ex); } } else { handleNonPostMethod(httpServletRequest, httpServletResponse, handler); } return null; }
@Override protected InputStream getRequestInputStream() throws IOException { return getHttpServletRequest().getInputStream(); }
@Override public void onClose() throws IOException { if (!statusCodeSet) { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_ACCEPTED); } }
@Override public ModelAndView handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception { if (HttpTransportConstants.METHOD_POST.equals(httpServletRequest.getMethod())) { WebServiceConnection connection = new HttpServletConnection(httpServletRequest, httpServletResponse); try { handleConnection(connection, (WebServiceMessageReceiver) handler); } catch (InvalidXmlException ex) { handleInvalidXmlException(httpServletRequest, httpServletResponse, handler, ex); } } else { handleNonPostMethod(httpServletRequest, httpServletResponse, handler); } return null; }
@Override protected InputStream getRequestInputStream() throws IOException { return getHttpServletRequest().getInputStream(); }
@Override public void addResponseHeader(String name, String value) throws IOException { getHttpServletResponse().addHeader(name, value); }
@Override public ModelAndView handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object handler) throws Exception { if (HttpTransportConstants.METHOD_POST.equals(httpServletRequest.getMethod())) { WebServiceConnection connection = new HttpServletConnection(httpServletRequest, httpServletResponse); try { handleConnection(connection, (WebServiceMessageReceiver) handler); } catch (InvalidXmlException ex) { handleInvalidXmlException(httpServletRequest, httpServletResponse, handler, ex); } } else { handleNonPostMethod(httpServletRequest, httpServletResponse, handler); } return null; }
@Override protected InputStream getRequestInputStream() throws IOException { return getHttpServletRequest().getInputStream(); }
@Override protected OutputStream getResponseOutputStream() throws IOException { return getHttpServletResponse().getOutputStream(); }
@Override public Iterator<String> getRequestHeaderNames() throws IOException { return new EnumerationIterator<String>(getHttpServletRequest().getHeaderNames()); }
@Override public void endpointNotFound() { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_NOT_FOUND); statusCodeSet = true; }
@Override @SuppressWarnings("unchecked") protected Iterator<String> getRequestHeaderNames() throws IOException { return new EnumerationIterator(getHttpServletRequest().getHeaderNames()); }
@Override public void endpointNotFound() { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_NOT_FOUND); statusCodeSet = true; }
@Override @SuppressWarnings("unchecked") protected Iterator<String> getRequestHeaders(String name) throws IOException { return new EnumerationIterator(getHttpServletRequest().getHeaders(name)); }
@Override public void onClose() throws IOException { if (!statusCodeSet) { getHttpServletResponse().setStatus(HttpTransportConstants.STATUS_ACCEPTED); } }
@Override public Iterator<String> getRequestHeaderNames() throws IOException { return new EnumerationIterator<String>(getHttpServletRequest().getHeaderNames()); }