I'm trying to adapt Ryan Bates's railscast http://railscasts.com/episodes/290-soap-with-savon?autoplay=true to use Savon to a wsdl, but I'm getting "ArgumentError (unknown keyword: :message)"
Step by step: brazilian mail company
- wsdl: https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl
- test it on SoapUI 5.5.0
New Soap Project
Initial wsdl: https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl
Service: consulta cep
after hitting request 1, I get
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cli="http://cliente.bean.master.sigep.bsb.correios.com.br/"> soapenv:Header/ soapenv:Body cli:consultaCEP ? </cli:consultaCEP> </soapenv:Body> </soapenv:Envelope>
"cep" means "zip code", and Replacing "?" for "81531980" (a valid zip code), and submitting request I get the following:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> soap:Body <ns2:consultaCEPResponse xmlns:ns2="http://cliente.bean.master.sigep.bsb.correios.com.br/"> Jardim das Américas 81531980 Curitiba Avenida Coronel Francisco Heráclito dos Santos 100 PR </ns2:consultaCEPResponse> </soap:Body> </soap:Envelope>
The next step is to do the same with savon. So, I created a new rails app, bundle savon gem and enter console:
> rails c
2.7.0 :001 > client = Savon.client(wsdl: "https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl")
2.7.0 :002 > client.operations
... :consulta_cep ...
2.7.0 :003 > response = client.call(:consulta_cep, message: { cep: '81531980'} )
Traceback (most recent call last):
1: from (irb):10
Savon::SOAPFault ((soap:Server) The given SOAPAction consultaCEP does not match an operation.)
2.7.0 :004 > response = client.call(:cli, :consulta_cep, message: { cep: '81531980'} )
Traceback (most recent call last):
2: from (irb):10
1: from (irb):11:in `rescue in irb_binding'
ArgumentError (unknown keyword: :message)
what am I doing wrong?