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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:38:39+00:00 2026-05-21T06:38:39+00:00

First off, sorry for what I know is terrible idiomatic Ruby code. I am

  • 0

First off, sorry for what I know is terrible idiomatic Ruby code.

I am trying to issue a series of SOAP requests to Oracle CRM OnDemand using a ruby script and I am running into a problem. I can issue the requests just fine using Poster for FireFox, but when I try and issue them with Ruby, it kicks back the following:

Internal Error: Session is not available. Aborting.

Oracle CRM OnDemand requires an authorization session cookie. Below is the code that I am using:

httpOracle = Net::HTTP.new(ORACLE_BASE_URL, ORACLE_PORT)
httpOracle.use_ssl = true
httpOracle.verify_mode = OpenSSL::SSL::VERIFY_NONE
httpOracle.set_debug_output $stderr

begin
    # CONNECT TO ORACLE AND RETRIEVE A SESSION ID
    pathOracle = buildOracleLoginPath()
    headOracle = { "username" => ORACLE_USERNAME,
                   "password" => ORACLE_PASSWORD }
    respOracle = httpOracle.request_head(pathOracle, headOracle)
    authOracle = respOracle['set-cookie']
                           .gsub(/ /, '')
                           .split(';')
                           .find_all { |item| item.match(/^JSESSIONID=/) }[0].to_s

    # RETRIEVE ALL ORACLE LEADS
    pathOracle = buildOraclePath(authOracle)
    headOracle = { "soapaction" => buildOracleSOAPAction("Lead", "QueryPage"),
                   "Content-Type" => "text/xml" }
    rqstOracle = loadPostData 'soap.xml' # Loads file with SOAP payload as a string
    respOracle = httpOracle.request_post(pathOracle, rqstOracle, headOracle)

    puts respOracle    # for testing
rescue
    puts "Error #{$!}"
ensure
    # CLOSE THE CONNECTION TO ORACLE
    pathOracle = buildOracleLogoffPath()
    headOracle = { authOracle.split('=')[0] => authOracle.split('=')[1] }
    respOracle = httpOracle.request_head(pathOracle, headOracle)
end

I can take the outputs of each of those commands and pump it through Poster (login, query, logoff) and it will work flawlessly, but for some reason, it looks like something is wrong having it bundled together in a script.

I was wondering if maybe trying to use the same Net::HTTP for multiple connections is the problem? Or maybe I am just not using it the right way?

If someone needs it, I can try and figure out how to redirect the http output to a file so that you can see the postings if that is helpful.

Thanks!

  • 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-21T06:38:39+00:00Added an answer on May 21, 2026 at 6:38 am

    I guess that typing it out gave me some more search criteria to work off of and I stumbled on this blog post. Although I would still like to know what I was doing wrong (I think that I have to use something like http.start {} to make this work), and how my code differs from clicking the buttons in Poster, adding WS-SECURITY headers to the SOAP request solved the problem completely by making it a stateless request instead of having to maintain the state throughout the life of the process.

    Thanks to anyone who took the time to read this!

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

Sidebar

Related Questions

First off - sorry for the wall of code but it's not too horrendous,
First off, there's a bit of background to this issue available on my blog:
First off, I know next to nothing about language theory, and I barely know
First off, I want to apologize beforehand, as I know there is a lot
Hey guys, first off all sorry, i can't login using my yahoo provider. anyways
First off, sorry for the lame title, but I couldn't think of a better
first of all sorry for the title. I know this is not so clear
First off, sorry if the title is confusing! I'm working on a part of
First off, I'm rather n00b at AS3 so I'm sorry if this is a
First off, I am sorry if this is a duplicate, but every time I

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.