Announcement Announcement Module
No announcement yet.
Integration of Jetty Continuation with Webservice stack Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integration of Jetty Continuation with Webservice stack


    I want to integrate Jetty's continuation with Spring-WS stack.

    Has anybody tried Jetty continuations (or Servlet 3.0 style Async servlets, for that matter the approach should be the same) with Webservice stack?

    Below is how I achieved:

    If you look at the request stacktrace, it looks like:
    SoapMessageDispatcher(MessageDispatcher).dispatch( MessageContext) line: 228
    SoapMessageDispatcher(MessageDispatcher).receive(M essageContext) line: 170
    WebServiceMessageReceiverHandlerAdapter(WebService MessageReceiverObjectSupport).handleConnection(Web ServiceConnection, WebServiceMessageReceiver) line: 88
    WebServiceMessageReceiverHandlerAdapter.handle(Htt pServletRequest, HttpServletResponse, Object) line: 57
    DispatcherServlet.doDispatch(HttpServletRequest, HttpServletResponse) line: 774

    WebServiceMessageReceiverObjectSupport is the class which handles WebService request connection. It reads the SOAP envelope header and creates MessageContext context instance.

    So ideally when 'continuation' is resumed, the request stream should not be read again. So basically I set the Message Context as the attribute in continuation and when the request is resumed, read the MessageContext from attribute instead of stream.

    Problem with the approach above, is WebServiceMessageReceiverObjectSupport 's 'handleConnection' method is final and cannot be overriden. WebServiceMessageReceiverHandlerAdapter extends WebServiceMessageReceiverObjectSupport class. To provide continuation support, I just need to provide custom behavior to handle MessageContext. With this approach, I need to unnecessary copy the code from 2 classes (WebServiceMessageReceiverObjectSupport & WebServiceMessageReceiverHandlerAdapter).

    Is anyone faced similar requirement before or having any better way to achieve this?

    Is spring-ws have support for Jetty Continuation and I am missing some information here?

    Any help on this will be highly appreciated.

    Thanks & regards,
    Gagan Jain