Soap4R - Question

B

Ball Balla

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_KEY>somevalue</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_KEY>somevalue</n1:MY_KEY>
</env:Header>

How can I accomplish this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top