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

  • Home
  • SEARCH
  • 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 6102585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:37:52+00:00 2026-05-23T13:37:52+00:00

In a SOAP Request, I need to specify repeated keys with different values like

  • 0

In a SOAP Request, I need to specify repeated keys with different values like this:

soap.body = {:query => {
    :fields => {
        :string => 'Email',
        :string => 'FirstName',
        :string => 'LastName'
    }
}

With this hash, the request will be formed with:

<query><fields><string>LastName</string></fields></query>

The last :string pair. So if I put:

soap.body = {:query => {
    :fields => "<string>Email</string>FirstName<string></string>LastName<string></string>"
}

This will result in:

<fields>&lt;string&gt;Email&lt;/string&gt;&lt;string&gt;FirstName&lt;/string&gt;&lt;string&gt;LastName&lt;/string&gt;</fields>

Is there a way to get this in a hash?:

<query><fields><string>Email</string><string>FirstName</string><string>LastName</string></fields></query>

Note: I’m using Ruby 1.8.7.

  • 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-23T13:37:52+00:00Added an answer on May 23, 2026 at 1:37 pm

    Your first code cannot work and it’s not Savon’s fault, repeated keys in a hash are simply overriden. Did you try with an array?

    soap.body = {
      :query => {
        :fields => {:string => ['Email', 'FirstName', 'LastName'],
      }
    }
    

    Check also this: https://github.com/rubiii/savon/issues/45

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to send a soap-request that looks like this: <v:Envelope xmlns:i=http://www.w3.org/2001/XMLSchema-instance xmlns:v=http://schemas.xmlsoap.org/soap/envelope/> <v:Header/>
We have a wrapper around a suds (SOAP) request, that we use like this
I have a SOAP request that is known to work using a tool like,
I need to sign my soap request to a 3rd party. The provided an
My question is similar to this one: need to call soap ws without wsdl
I would like to get a sample SOAP Request for a given action from
I've inherited a BizTalk 2006 application that uses several SOAP ports to request data
I'm using Apache Axis2 and need to send a custom XML structure over SOAP
Consider this example SOAP Client script: $SOAP = new SoapClient($WDSL); // Create a SOAP
I have been tasked with obtaining a response from a SOAP request, using classic

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.