# Ruby soap4r header problem

**URL:** <https://www.ruby-forum.com/t/ruby-soap4r-header-problem/174867>\
**Category:** Ruby\
**Created:** [September 3, 2009, 9:08am UTC](https://www.ruby-forum.com/t/ruby-soap4r-header-problem/174867 "2009-09-03T09:08:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@bogea](https://www.ruby-forum.com/u/bogea)\
**Post date:** [September 3, 2009, 9:08am UTC](https://www.ruby-forum.com/t/ruby-soap4r-header-problem/174867/1 "2009-09-03T09:08:05Z")

</div>

Hi,

I am trying to build a header using soap4r that is supposed to look like  
this

```
<SOAP-ENV:Header>

```

\<ns1:UserAuthentication  
SOAP-ENV:mustUnderstand=“1”  
SOAP-ENV:actor=“http://…api.address.com”\>  
ns1:iId_**\</ns1:iId\>  
 ns1:sPassword**_\</ns1:sPassword\>  
ns1:sTypeaffiliate\</ ns1:sType\>  
\</ns1:UserAuthentication\>

\<ns1:getQuota SOAP-ENV:mustUnderstand=“1” SOAP-  
ENV:actor=“[http://api.affiliatewindow.com](http://api.affiliatewindow.com)”\>true\</ns1:getQuota\>  
\</SOAP-ENV:Header\>

What I have done is created a header derv. class

AffHeader \< SOAP::Header::SimpleHandler

Created a UserAuthentification element.

def initialize  
@element = XSD::QName.new(nil, “UserAuthentification”)  
super(@element)  
end

And return a hash

def on\_simple\_outbound  
self.mustunderstand = 1  
{ “iId” =\> ID, “sPassword” =\> PASSWORD, “sType” =\> “affiliate” }  
end

How can I make my header look like I want further. How do I add the  
actor for example.

I am going to keep searching on this, any Help is very appreciated.

Thank you
