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 8962741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:11:58+00:00 2026-06-15T16:11:58+00:00

I am trying to add an API Key element to a SOAP header using

  • 0

I am trying to add an API Key element to a SOAP header using Savon, but am fighting a losing battle. I am fairly new to Ruby and the little I do know is self taught. According their API docs this is what I need to add:
This ProductServe function will return (SOAP-Header) the authentication element and this has to be sent with every single request.

Parameters

Required  Name     Type    Description                              Min Occurs Max Occurs
No        sToken   string  Unique token to identify visitor.        0          1
Yes       sApiKey  string  User specific key to authenticate user.  1          1

http://wiki.affiliatewindow.com/index.php/UserAuthentication

I haven’t managed to find anything that resembles what I want to do and this is the code I have tried:

endpoint = "http://v3.core.com.productserve.com/ProductServeService.wsdl"
client = Savon.client

response = client.request :urn, "getCategory" do
  soap.endpoint = endpoint
  soap.header = {
    "urn:sApiKey" => "xxxx"
  }
end

Any help would be greatly appreciated!

  • 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-06-15T16:12:00+00:00Added an answer on June 15, 2026 at 4:12 pm

    Looks like you need to configure your Savon client:

    client = Savon::Client.new do
      wsdl.document = endpoint
      wsdl.element_form_default = :unqualified
    end
    

    I made those changes and the rest of your code returned a valid SOAP response.

    Shamelessly cribbed from this question

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

Sidebar

Related Questions

Im new to asp.net mvc. I'm trying add new model class but it got
I am trying to get a google API key to add google maps to
I'm using WCF REST service with API key template and trying to enforce validation
I'm trying to add a public API to my app to allow users to
I'm trying to add a field to the List provided by the Spotify API.
I am trying to use the Google Map API- I've successfully managed to add
Trying to add a blank sample app for a rails tutorial to GitHub, but
Im trying out the Google Maps API Geocoding feature.The map loads fine, but im
I'm trying to add a composite primary key to a class and having a
I am trying to add a sanity check with respect to API, which tends

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.