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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:33:56+00:00 2026-05-12T19:33:56+00:00

So I need to access this service from my rails app. I’m using soap4r

  • 0

So I need to access this service from my rails app. I’m using soap4r to read the WSDL and dynamically generate methods for accessing the service.

From what I’ve read, I should be able to chain methods to access the nested XML nodes, but I can’t get it to work. I tried using the wsdl2ruby command and read through the generated code. From what I can tell, the soap library is not generating these accessor methods. I’m pretty new to ruby, so I don’t know if I’m just missing something?

I know when I inspect the element, I can see the data I want. I just can’t get to it.

For instance if I use the following code:

require "soap/wsdlDriver"
wsdl = "http://frontdoor.ctn5.org/CablecastWS/CablecastWS.asmx?WSDL"
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
response = driver.getChannels('nill')
puts response.inspect

I get the following output:

ignored element: {http://schemas.xmlsoap.org/wsdl/soap12/}binding
ignored element: {http://schemas.xmlsoap.org/wsdl/soap12/}operation
ignored element: {http://schemas.xmlsoap.org/wsdl/soap12/}body
ignored element: {http://schemas.xmlsoap.org/wsdl/soap12/}address
#<SOAP::Mapping::Object:0x80b96394 {http://www.trms.com/CablecastWS/}GetChannelsResult=#<SOAP::Mapping::Object:0x80b96178 {http://www.trms.com/CablecastWS/}Channel=[#<SOAP::Mapping::Object:0x80b95f5c {http://www.trms.com/CablecastWS/}ChannelID="1" {http://www.trms.com/CablecastWS/}Name="CTN 5">, #<SOAP::Mapping::Object:0x80b9519c {http://www.trms.com/CablecastWS/}ChannelID="2" {http://www.trms.com/CablecastWS/}Name="PPAC 2">, #<SOAP::Mapping::Object:0x80b94620 {http://www.trms.com/CablecastWS/}ChannelID="14" {http://www.trms.com/CablecastWS/}Name="Test Channel">]>>

So the data is definitely there!

Here is the code generated by wsdl2ruby for the method being used above:

# {http://www.trms.com/CablecastWS/}GetChannels
class GetChannels
  def initialize
  end
end

# {http://www.trms.com/CablecastWS/}GetChannelsResponse
#   getChannelsResult - ArrayOfChannel
class GetChannelsResponse
  attr_accessor :getChannelsResult

  def initialize(getChannelsResult = nil)
    @getChannelsResult = getChannelsResult
  end
end

Sorry for the long post, I figured the more info the more likely someone can point me in the right direction.

Thanks

-ray

  • 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-12T19:33:56+00:00Added an answer on May 12, 2026 at 7:33 pm

    Answer

    require "soap/wsdlDriver"
    wsdl = "http://frontdoor.ctn5.org/CablecastWS/CablecastWS.asmx?WSDL"
    driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
    response = driver.getChannels('nill')
    
    for item in response.getChannelsResult.channel
      puts item.name
      puts item.channelID
    end
    

    How I got the Answer

    You can figure out the methods of response via

    response.methods
    

    This will get you a long list of methods that are hard to sort through, so I like to subtract out the generic methods. Ruby lets you subtract arrays.

    response.methods - Object.new.methods
    

    Using this technique, I found the getChannelsResult method for response. I repeated the process

    resonse.getChannelsResult.methods - Object.new.methods
    

    I found the channel method for its result. Again!

    response.getChannelsResult.channel.methods - Object.new.methods
    

    This returned a bunch of methods including: sort, min, max etc. So I guessed Array. A simple confirmation was in order

    response.getChannelsResult.channel.class
    

    Sure enough it returned Array. To make life simple, I just worked with the first item of the array to get its methods

    response.getChannelsResult.channel.first.methods - Object.new.methods
    

    Whoalla, I found two more methods “name” and “channelID”

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

Sidebar

Related Questions

Let's say I need to access a web service from an iPhone app. This
I'm using jquery to access a asp.net web service from my website. This web
I have a file as documentRoot/app/webroot/myFile.php I need to be able to access this
I need to access a web service from a J2ME application. Any good advice
I need to access the response from a .NET web service which returns data
I need to access Web Service from .NET Compact Framework 3.5 application. Problem is
I need to access the FOV property of the Perspective viewport. This is not
The problem is this: I have multiple competing threads (100+) that need to access
I need to migrate Access databases to SQL Server 2005. Since this needs to
I need to enable crossdomain access on FF and Safari. I did this on

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.