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

          hstoerr Hans-Peter Störr created issue -
          arjen.poutsma Arjen Poutsma made changes -
          Field Original Value New Value
          Fix Version/s 1.5.6 [ 11141 ]
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue is related to SWS-263 [ SWS-263 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment - - edited

          SWS-263 seems related to what you're trying to do.

          That said, the connection should not be opened. I will fix.

          Show
          arjen.poutsma Arjen Poutsma added a comment - - edited SWS-263 seems related to what you're trying to do. That said, the connection should not be opened. I will fix.
          arjen.poutsma Arjen Poutsma made changes -
          Original Estimate 0.5d [ 14400 ]
          Remaining Estimate 0.5d [ 14400 ]
          arjen.poutsma Arjen Poutsma made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          I tried fixing this without breaking backwards compatibility and also make sure that all the various other transports and callbacks kept working, but couldn't. So I am resolving this as Won't Fix, unfortunately.

          Overall, taking the route of a Mock Transport (SWS-263) for doing integration tests on web services would have my preference for the scenario you describe.

          Show
          arjen.poutsma Arjen Poutsma added a comment - I tried fixing this without breaking backwards compatibility and also make sure that all the various other transports and callbacks kept working, but couldn't. So I am resolving this as Won't Fix, unfortunately. Overall, taking the route of a Mock Transport ( SWS-263 ) for doing integration tests on web services would have my preference for the scenario you describe.
          arjen.poutsma Arjen Poutsma made changes -
          Resolution Won't Fix [ 2 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closing old issues

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closing old issues
          arjen.poutsma Arjen Poutsma made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          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: