Skip to content

Instantly share code, notes, and snippets.

@mdamaceno
Last active December 1, 2015 04:56
Show Gist options
  • Save mdamaceno/78abd0fe2612f9c43a79 to your computer and use it in GitHub Desktop.
Save mdamaceno/78abd0fe2612f9c43a79 to your computer and use it in GitHub Desktop.
Example using WSDL in Ruby
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