Last active
December 1, 2015 04:56
-
-
Save mdamaceno/78abd0fe2612f9c43a79 to your computer and use it in GitHub Desktop.
Example using WSDL in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'savon' | |
client = Savon.client(wsdl: 'http://tadeuclasse.zz.mu/WSCartao/Server.php?wsdl') | |
response = client.call(:validar_cartao, message: { | |
tDadosCartao: { | |
"NumeroCartao" => "4522669988574455", | |
"Codigo" => "168", | |
"NomeCliente" => "Marco Damaceno", | |
"Validade" => "201612", | |
"Valor" => "150", | |
"Parcelas" => "2", | |
"NomeEmpresa" => "Marco Damaceno LTDA", | |
"CNPJEmpresa" => "236000157000105" | |
}, | |
:attributes! => { | |
tDadosCartao: { | |
"NumeroCartao" => { "xsi:type" => "xsd:string" }, | |
"Codigo" => { "xsi:type" => "xsd:int" }, | |
"NomeCliente" => { "xsi:type" => "xsd:string" }, | |
"Validade" => { "xsi:type" => "xsd:string" }, | |
"Valor" => { "xsi:type" => "xsd:double" }, | |
"Parcelas" => { "xsi:type" => "xsd:int" }, | |
"NomeEmpresa" => { "xsi:type" => "xsd:string" }, | |
"CNPJEmpresa" => { "xsi:type" => "xsd:string" } | |
} | |
} | |
}) | |
puts response.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment