From: Rob Biedenharn Date: 2009-02-19T23:00:08+09:00 Subject: Re: HTTPS connection On Feb 19, 2009, at 7:27 AM, Bob Smyph wrote: >> Without seeing the code you're trying or the actual response that >> comes back, I have to just guess. >> >> -Rob > > the program I'm working on was developed by someone else and is > extremely over complicated but I will try to explain it here. > > Part 1 - in my C-suite > def setup > startup > vru = Regression::ISAC::VRU.new You're initialize gets called as part of the behavior of .new right here. > > vru.fraud_alert("AlertPlacement", "INITIAL_FRAUD", > @consumer.consumer_id, @consumer.first_name, @consumer.last_name, > @consumer.ssn, @consumer.dob, @consumer.address, > @consumer.city,@consumer.state, @consumer.zip) Why pass all those attributes separately? (not that it really changes anything) > > @event = Regression::ISAC::Event.new(@user_isac_ie, EVENT_TYPE, > @consumer, vru.get_event_id) (Except that you pass @consumer here.) > end > > -- the vru.get_event_id and vru.fraud_alert calls this next portion > Part 2 - in my VRU class > > > def get_tag_data(tag_name) > return > @xml_content[(@xml_content.index("<#{tag_name}>") > +2+tag_name.length)...@xml_content.index("")] > end Ooh, you really should use XPath selectors here or parse the data with Hpricot or Nokogiri or even REXML. > > def initialize(host = "172.31.3.97", port = 8080) > @connection = Net::HTTP.new(host, port) > @connection.use_ssl = true > @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE Did you mean to save the response here? @response = > @connection.get '/' > end Or otherwise show where @xml_content gets set? > def get_event_id > return get_tag_data("eventId") > end > > -- vru.fraud_alert calls the initialize and then goes to create my > https > alert string. The changes you showed me, I think, got me pass the SSL > issues but now I can not get the other portions to work. I need to get > the XML back from the request so that I can take information from the > tag of 'eventId' > -- vru.get_event_id is calling the get_event_id which then > > The error that I am getting as of right now is > NoMethodError: undefined method `+' for nil:NilClass > c:\ruby\qa\isac\regression suite\regression\isac\vru.rb:40:in > `get_tag_data' > c:\ruby\qa\isac\regression suite\regression\isac\vru.rb:80:in > `get_event_id' > C:/ruby/QA/ISAC/Regression > Suite/ALRT/Valid_Consumer/Concurrency.rb:27:in `setup' If you look at the docs for String#index, you'll see that the result is nil when the parameter string is not found: irb> "hello, world!".index('a') => nil > I think this is all that you would need. Please let me know if there > is > anything else I need to help you help me. > > Thanks Have you tried to use any of this manually from an irb session? You should at least be able to get the "readonly" parts working there (or find out what error-checking you need--like failed method calls). -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com