# How to add Header information to a SOAP request

**URL:** <https://www.ruby-forum.com/t/how-to-add-header-information-to-a-soap-request/182929>\
**Category:** Ruby\
**Created:** [February 4, 2010, 10:16pm UTC](https://www.ruby-forum.com/t/how-to-add-header-information-to-a-soap-request/182929 "2010-02-04T22:16:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 4, 2010, 10:16pm UTC](https://www.ruby-forum.com/t/how-to-add-header-information-to-a-soap-request/182929/1 "2010-02-04T22:16:08Z")

</div>

I want to add some information to the header of a SOAP request. How  
would I do that. I plan on just using the ruby core SOAP module.

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 4, 2010, 11:44pm UTC](https://www.ruby-forum.com/t/how-to-add-header-information-to-a-soap-request/182929/2 "2010-02-04T23:44:03Z")

</div>

On Fri, Feb 05, 2010 at 06:16:13AM +0900, Chris G. wrote:

> I want to add some information to the header of a SOAP request. How  
> would I do that. I plan on just using the ruby core SOAP module.

Wow, 2 times in 1 month, dealing with soap header requests…

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/222199](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/222199)

See if that works for you.

enjoy,

-jeremy

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [February 4, 2010, 11:29pm UTC](https://www.ruby-forum.com/t/how-to-add-header-information-to-a-soap-request/182929/3 "2010-02-04T23:29:14Z")

</div>

I just installed Savon gem and did the following to get it to work:

@client = Savon::Client.new “[https://asdflskdjf.com?WSDL](https://asdflskdjf.com?WSDL)”  
@client.request.basic\_auth(“user”, “pass”)  
@client.soap\_action\_you\_want\_to\_execute

Find docs at [http://rdoc.info/projects/rubiii/savon](http://rdoc.info/projects/rubiii/savon)

This is kinda a dup of my previous post.
