Skip to content

Instantly share code, notes, and snippets.

@JosiahSiegel
Last active June 2, 2017 17:17
Show Gist options
  • Save JosiahSiegel/1e1d90210726322031b3 to your computer and use it in GitHub Desktop.
Save JosiahSiegel/1e1d90210726322031b3 to your computer and use it in GitHub Desktop.
#Rails Use Savon to make SOAP request
def self.soap_method(input)
c = Savon.client(wsdl: 'http://0.0.0.0/path_of_wsdl.wsdl', ssl_verify_mode: :none)
r = c.call(:soap_method, xml:
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:com='http://www.company.com'>
<soapenv:Header/>
<soapenv:Body>
<com:SoapMethod>
<com:input>
<!--Soap Body-->
</com:input>
</com:SoapMethod>
</soapenv:Body>
</soapenv:Envelope>")
r.body[:response]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment