Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-2187

Handler Chain Management Prevents Service Re-Use

XMLWordPrintable

      There are a couple of issues relating to how the handler configuration is managed by the javax.xml.ws.Service.

      1 - Handlers Added Multiple Times

      Create new service.
      Create port
      setConfigName("Standard WSSecurity Client")
      Call endpoint.

        • All works fine and WS-Security headers are added to outbound message. **

      Create port
      setConfigName("Standard WSSecurity Client")
      Call endpoint.

        • Now the WS-Security headers are added to the outgoing message twice **

      The creation of the port initialises the handler chain but it does not clear the old handlers, as the list of handlers is referenced by the Service each port creation adds a new set of handlers.

      2 - Thread safety.

      Due to the above behaviour is becomes apparent that even if each thread uses it's own Port there is still a common Service so setting the configuration on one Port will affect the other Port instances, in addition to this as the configuration uses a HandlerResolver also Collections local to the Service there is a possibility that these will be modified and accessed by different threads concurrently.

            darran.lofthouse@redhat.com Darran Lofthouse
            darran.lofthouse@redhat.com Darran Lofthouse
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: