1

System:

ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-darwin20]

savon 2.12.1

My client setup looks like this

def client
  @client ||= Savon.client do
    log true
    wsdl BASE_URL
    pretty_print_xml true
    ssl_verify_mode :none
  end
end

When I looked into logs to verify the XML that is generated by Savon I noticed that some parameters are just missing. In this case it's customerID

Request:

client.call(:authenticate, message: { customerID: 123456, passphrase: 'qwertyasdfg' })

Logs:

I, [2021-07-06T13:06:29.621011 #39758]  INFO -- : SOAP request: *filtered*
I, [2021-07-06T13:06:29.621067 #39758]  INFO -- : SOAPAction: "*filtered*", Content-Type: text/xml;charset=UTF-8, Content-Length: 569
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="*filtered*" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <authenticate>
      <customerID xsi:type="xsd:nonNegativeInteger"/>
      <passphrase xsi:type="xsd:normalizedString">qwertyasdfg</passphrase>
      <sandbox xsi:type="xsd:boolean"/>
      <locale xsi:type="tns:Locale"/>
      <demo xsi:type="xsd:boolean"/>
    </authenticate>
  </env:Body>
</env:Envelope>

D, [2021-07-06T13:06:29.621467 #39758] DEBUG -- : HTTPI /none POST request to *filtered* (httpclient)
I, [2021-07-06T13:06:29.994037 #39758]  INFO -- : SOAP response (status 400)
D, [2021-07-06T13:06:29.994316 #39758] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Client</faultcode>
      <faultstring>Failed to authenticate.</faultstring>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

You can see here that customerID param is not populated with the value 123456 . Am I missing anything in my setup? It's not the first case. It also happened on other requests so I have to build XML separately and operate with the API with raw XMLs

Kson
  • 76
  • 7

0 Answers0