Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Pass `doc` to `on_before_dispatch` #37

Merged
merged 1 commit into from

2 participants

@joncanady

This allows users to log outgoing documents before they are sent.

This may break backwards compatibility by changing the arity of on_before_dispatch, but we couldn't get the tests to run via rake test so we're unsure of how to test that we're not breaking every existing implementation.

Brian Pokosh & Jon Canady Pass `doc` to `on_before_dispatch`
This allows users to log outgoing documents before they are sent.
2511a03
@troelskn
Collaborator

Makes sense why you'd want this. I guess the BC is acceptable here - Breakage will be trivial to fix.

@troelskn troelskn merged commit 0eea48b into unwire:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2013
  1. Pass `doc` to `on_before_dispatch`

    Brian Pokosh & Jon Canady authored
    This allows users to log outgoing documents before they are sent.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/handsoap/service.rb
View
6 lib/handsoap/service.rb
@@ -244,7 +244,7 @@ def invoke(action, options = { :soap_action => :auto, :http_options => nil }, &b
"Content-Type" => "#{self.request_content_type}; charset=UTF-8"
}
headers["SOAPAction"] = options[:soap_action] unless options[:soap_action].nil?
- on_before_dispatch
+ on_before_dispatch(doc)
request = make_http_request(self.uri, doc.to_s, headers, options[:http_options])
response = http_driver_instance.send_http_request(request)
parse_http_response(response)
@@ -299,7 +299,7 @@ def async(user_block, &block) # :yields: Handsoap::AsyncDispatch
"Content-Type" => "#{self.request_content_type}; charset=UTF-8"
}
headers["SOAPAction"] = options[:soap_action] unless options[:soap_action].nil?
- on_before_dispatch
+ on_before_dispatch(doc)
request = make_http_request(self.uri, doc.to_s, headers)
driver = self.http_driver_instance
if driver.respond_to? :send_http_request_async
@@ -361,7 +361,7 @@ def on_create_document(doc)
# Hook that is called before the message is dispatched.
#
# You can override this to provide filtering and logging.
- def on_before_dispatch
+ def on_before_dispatch(doc)
end
# Hook that is called after the http_client is created.
#
Something went wrong with that request. Please try again.