# Soap4R - Question

**URL:** <https://www.ruby-forum.com/t/soap4r-question/158167>\
**Category:** Ruby\
**Created:** [January 20, 2009, 12:06am UTC](https://www.ruby-forum.com/t/soap4r-question/158167 "2009-01-20T00:06:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![balla123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@balla123](https://www.ruby-forum.com/u/balla123)\
**Post date:** [January 20, 2009, 12:06am UTC](https://www.ruby-forum.com/t/soap4r-question/158167/1 "2009-01-20T00:06:39Z")

</div>

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?
