Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6188191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:11:24+00:00 2026-05-24T02:11:24+00:00

The header in my SOAP doc needs to have an attribute like this: <soap:Header>

  • 0

The header in my SOAP doc needs to have an attribute like this:

<soap:Header>
<eWAYHeader xmlns="https://www.eway.com.au/gateway/managedpayment">
  <eWAYCustomerID>string</eWAYCustomerID>
  <Username>string</Username>
  <Password>string</Password>
</eWAYHeader>

The eWAYHeader needs an xmlns attribute.

I’ve tried

    def create_customer(customer, card)
    response = @client.request(:create_customer, "xmlns" => "https://www.eway.com.au/gateway/managedpayment") do
      soap.header = header
      soap.body = create_customer_body(customer, card)
    end
  end

  private

  def header
    {
      "eWAYHeader" => {
        :attributes! => { :xmlns => 'http://www.eway.com.au/gateway/managedpayment' },
        "eWayCustomerID" => '87654321',
        "Username" => 'test@eway.com.au',
        "Password"=> 'test123'
      }
    }
  end

but the attributes! entry is ignored.

soap.header will only accept a Hash as an argument so I can’t just set it’s value using a string.

How do I achieve this in Savon?

thanks,

Martin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:11:25+00:00Added an answer on May 24, 2026 at 2:11 am

    You can achieve by doing this

    soap.header = {
      "eWAYHeader" => {
        "eWayCustomerID" => '87654321',
        "Username" => 'test@eway.com.au',
        "Password"=> 'test123'
      },
      :attributes! => {"eWAYHeader" => { :xmlns => 'http://www.eway.com.au/gateway/managedpayment' } }, }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add this attribute ( xmlns:wsa=http://www.w3.org/2005/08/addressing ) to the soap header, like
How do you add create a SOAP web service header? Example <soap:Header> <myHeader xmlns=https://www.domain.com>
Everybody, Hello! This is my request message: <soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/> <soap:Header> <wsse:Security xmlns:wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd soap:mustUnderstand=1>
I had a .asmx web service that check parameters of soap header like this:
I have a client that wants to send a large number of SOAP Header
I have a fairly simple php/soap header question. Here's what I need. <ns1:Identity token=123456789></ns1:Identity>
I am signing a SOAP message on using Spring, this doc to be exactly.
Can I add Custom SOAP header in WCF incoming/outgoing messages in basicHttpBinding, like we
I want to send some info, like user credentials in the SOAP header from
Doing some SOAP calls to a 3rd party application. They provide this soap header

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.