Converting raw XML query to Savon 2 Format
have you looked into the resulting XML message?
you should set the parameters
log => true,
log_level => :debug,
pretty_print_xml => true
and have a look.
Savon using built in request builder instead of raw xml
I usually do just this (untested). It's not pretty but it works.
credentials = { 'ns1:username' => 'user',
'ns1:password' => 'pwd!!',
'ns1:cultureInfo' => "it" }
response = client.call(:authenticate, message: credentials)
You might want to adapt the use of ns1
to the actually used namespace in your case.
Can't get Savon to form the right XML
Long story short, I had to make 3 changes.
- Changed
response = client.request :language_count
toresponse = client.request "LanguageCount"
- Added
:xmlns => "http://tempuri.org/"
to the end of the client.request call - Explicitly called the SOAPaction like:
client.http.headers["SOAPAction"] = '"http://tempuri.org/FooService/LanguageCount"'
Hope this helps someone as I've been in SOAP hell for the weekend and hopefully I'll stop someone else being there.
Related Topics
How to Insert Erb-Tags with Vim
Gracefully Shutting Down Sidekiq Processes
Modern Tools for Ruby/Rails for Building an Achievement System
Rspec Error 'Report_Activate_Error': Could Not Find Rubygem Rspec-Core (>=0) (Gem:Loaderror)
Does Ruby Provide a Constant_Added Hook Method
Utc Time Resets to 2000-01-01 (Ruby). How to Prevent the Time from Resetting
Where to Place Private Methods in Ruby
Capistrano Deploy Fails After I Changed the Repository Url
Listen Error: Unable to Monitor Directories for Changes
How to Get a Reference to a 'Dynamic' Object Call
Duplicate Elements of Array in Ruby
Rails 4 Order by Virtual Attribute
How to Turn on SQL Debug Logging for Activerecord in Rspec Tests
Should I Specify Exact Versions in My Gemfile
How to Get Exit Status with Ruby's Net::Ssh Library
Open Firefox Browser with Ruby Automation Script
Error Loading the 'Sqlite3' Active Record Adapter. When I Deploy in Heroku
How to Ignore Irrelevant Methods When Profiling Ruby Applications