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


    • 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:


      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



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


                • Created: