ruby on rails - Savon: user not authorized -


i using savon gem accessing abc financial web services. getting error message user not authorize. using code accessing response

@wsdl="https://webservice.abcfinancial.com/wsdl/prospect.wsdl" @basic_auth=["user","pass"] @headers={"authorization" => "basic"}  @client = savon.client |globals|   globals.wsdl @wsdl   globals.basic_auth @basic_auth   globals.headers @headers end  @message = {   :clubnumber=> 'club 0233',    :firstname=> 'abc',    :lastname=> 'def',    :gender=> "male"   } response = @client.call(:insert_prospect, message: @message) 

and getting error message user not authorize. searched didn't find solution. please me.

they using jax-ws. according article http://examples.javacodegeeks.com/enterprise-java/jws/application-authentication-with-jax-ws/ (and google) should use login-password in http headers. don't have account on http://abcfinancial.com can't test code. try it:

require 'savon'  user = 'mylogin' password = 'mypassword'  client = savon.client(     wsdl: 'https://webservice.abcfinancial.com/wsdl/prospect.wsdl',     headers: {username: user,               password: password},     pretty_print_xml: true,     log: true )  message = {     :arg0 => {         clubnumber: 'club 0233',         :personal => {             :firstname => 'myname',             :lastname => 'mylastname',             :gender => 'male'         }     } }  response = client.call(:insert_prospect, message: message) 

read article http://predic8.com/wsdl-reading.htm , turn on debugging (pretty_print_xml: true, log: true).


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -