-
Notifications
You must be signed in to change notification settings - Fork 616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook should not replace request #291
Comments
Have explained the issue with hooks here, where I'm trying to measure time taken by each soap request. Since |
could you test whether this change works for you? there's a spec describing your use case. Savon.configure do |c|
c.hooks.define('new_hook', :soap_request) do |callback, req|
start_time = Time.now
response = callback.call
SavonInstrument.add req.http.headers['SoapAction'], Time.now - start_time
response
end
end |
It works!! Thank you!! |
you're welcome |
Right now the
Savon::Hooks::Hook
replaces the POST request executed to call a service. Ideally I would expect a hook to be called before/after/around the service call, not to replace the service call itself.I can return false from my hook and let the
Savon::SOAP::Request
class make the request by itself. But that'll be useful only if I'm interested in doing some stuff before the call.Hooks should be improvised to let user hook into events like 'before_request', 'after_request' etc.,
The text was updated successfully, but these errors were encountered: