Skip to content

Instantly share code, notes, and snippets.

/j.rb Secret

Created June 6, 2016 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0955414d62d050b22771308a47389ab3 to your computer and use it in GitHub Desktop.
Save anonymous/0955414d62d050b22771308a47389ab3 to your computer and use it in GitHub Desktop.
def call(credentials)
header_info = get_oauth_token(credentials)
namespaces = {"ns0" => "https://www...", "ns1" => "https://www...",}
client = Savon.client(wsdl: File.read('../endpoints/wsdl/....wsdl'),
endpoint: 'https://...',
namespaces: namespaces,
soap_header: {
"Authorization" => header_info[:token],
"csn" => "...",
"timestamp" => header_info[:timestamp],
"signature" => header_info[:signature],
"SOAPAction" => "/...",
"content-type" => "application/xml"
})
client.call(:match_account_contact, message: {"ns0:MatchAccountContactRequest" => {
"ns0:Request" => {
"ns1:..." => "..."
},
"ns0:RequestContext" => {
"ns0:.." => "..."
},
"ns0:Account" => {
"ns0:.." => "..."
}})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment