#!/usr/bin/env ruby # -*- coding: utf-8 -*- require 'savon' Savon.configure do |config| config.log = false config.log_level = :info end client = Savon::Client.new do #wsdl.document = "https://swissindex.refdata.ch/Swissindex/Pharma/ws_Pharma_V101.asmx?WSDL" wsdl.document = "https://index.ws.e-mediat.net/Swissindex/Pharma/ws_Pharma_V101.asmx?WSDL" end begin response = client.request :download_all do soap.xml = ' DE ' end rescue Savon::Error => error p erro.to_s exit end if response.success? hash = response.to_hash p hash.keys p hash[:pharma].keys p hash[:pharma][:result] p hash[:pharma][:item].first.keys #File.open('pharma.txt', 'w') do |f| # hash[:pharma][:item].each do |line| # f.puts line # end #end end