Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-440

WebServiceTemplate still creates a connection even if a ClientInterceptor sets a Response

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.5.6
    • Component/s: Core
    • Labels:
      None

      Description

      Problem: When a response is set on the messagecontext by a ClientInterceptor.handleRequest, an actual connection to the webservice is still created and the Webservice is actually accessed in hasError or hasFault. I would expect that the WebServiceTemplate would not even create a connection in this case.

      Background: I tried to write a ClientInterceptor for the WebServiceTemplate that simulates an actual webservice call during a selftest of the system. ClientInterceptor.hasRequest checks whether this is during a selftest and sets the response on the MessageContext and the other system should never be contacted at all.

      Possible Solutions:

      • As a quick fix one could extend the first if(messageContext.hasResponse() ) in WebServiceTemplate.doSendAndReceive(MessageContext, ...) to the hasError check, since this check does not make much sense if the response was not sent, does it? 8-)
      • Even if this quick fix is done, MessageContext.createConnection is still called, which does not seem appropriate to me. Perhaps this should be done only later, after the interceptors have been called?

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          94d 3h 13m 1 Arjen Poutsma 25/Jan/09 11:33 PM
          In Progress In Progress Resolved Resolved
          1d 23h 36m 1 Arjen Poutsma 27/Jan/09 11:09 PM
          Resolved Resolved Closed Closed
          1192d 7h 53m 1 Arjen Poutsma 04/May/12 7:03 AM

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              hstoerr Hans-Peter Störr
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: