Skip to content

Instantly share code, notes, and snippets.

@alexandreaquiles
Created November 28, 2014 00:03
Show Gist options
  • Save alexandreaquiles/129662cbdb13f945fc18 to your computer and use it in GitHub Desktop.
Save alexandreaquiles/129662cbdb13f945fc18 to your computer and use it in GitHub Desktop.
Cliente em Ruby para o WebService do curso FJ-31 atualizado para a versão 2 da biblioteca Savon
require "savon"
client = Savon.client({ :wsdl => "http://localhost:8080/fj31-loja-ejb3/ConsultaDeLivrosBean?wsdl"})
response = client.call(:busca_livro,
{ :message => { :nome => "Fausto" } } )
livros = response.body[:busca_livro_response][:return]
if(livros.nil?)
puts "Nenhum livro encontrado!"
else
puts "Encontrados: #{livros}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment