-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Hans-Peter Störr opened SWS-440 and commented
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?
Affects: 1.5.4
Issue Links:
- Provide xml based Mock for Web Services [SWS-263] #365 Provide xml based Mock for Web Services
1 votes, 0 watchers