LoginSignup
9
9

More than 5 years have passed since last update.

rubyのsoap client savonでBASIC認証

Last updated at Posted at 2014-01-24

savonを使ってみます。現時点ではversion3系はunstableなのでversion2系を使ってみました。

認証

APIがBASIC認証を要求する場合は以下のようにします。ドキュメントがなかなか見つからず小一時間苦労しました...。

get_operations.rb
#!/usr/bin/env ruby

require 'savon'

client = Savon.client(
  wsdl: 'https://server/wsdl',
  basic_auth:  ['username', 'userpasswordhere'],
  ssl_verify_mode: :none
)
p client.operations
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9