Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briandoll/6402 to your computer and use it in GitHub Desktop.
Save briandoll/6402 to your computer and use it in GitHub Desktop.
# Add unique header support to soap4r clients
# http://emphaticsolutions.com/index.php/2008/05/06/soap-headers-per-request-in-ruby/
#
require 'soap/header/handlerset'
class SOAP::Header::HandlerSet
# resets the internal handler store to an empty representation
def reset
@store = XSD::NamedElements.new
end
# will ensure the only headers available in this object is the one you pass in
def set(header)
reset
add header
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment