Soap4R - Question


#1

I am trying to add a custom header to my outgoing SOAP4R messages.

I figured out how to add a header by doing the following.

class ClientAuthHeaderHandler < SOAP::Header::Handler
NAMESPACE = XSD::QName.new(“somenamespace”, “test”)

def initialize
  super(NAMESPACE)
 end

def on_simple_outbound
  { "MY_KEY" => 'somevalue' }
end

end

driver = SOAP::WSDLDriverFactory.new(‘somewsdl’).create_rpc_driver
driver.headerhandler << ClientAuthHeaderHandler.new

Which will produce the following output for the header

env:Header
<n1:test xmlns:n1=“somenamespace” env:mustUnderstand=“0”>
n1:MY_KEYsomevalue</n1:MY_KEY>
</n1:test>
</env:Header>

But I do not want the n1:test namespace. IE all I want is

env:Header
n1:MY_KEYsomevalue</n1:MY_KEY>
</env:Header>

How can I accomplish this?