Skip to content

Commit

Permalink
Merge pull request #263 from genuitytech/override_soap_action
Browse files Browse the repository at this point in the history
Soap action can be set via the :soap_action key.
  • Loading branch information
rubiii committed Feb 17, 2012
2 parents 8420f8b + 5533212 commit 262de7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/savon/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def preconfigure(args)
soap.types[path] = type
end

set_soap_action args[1]
soap_action = args[2].delete(:soap_action) || args[1]
set_soap_action soap_action
set_soap_input *args
end

Expand Down
8 changes: 8 additions & 0 deletions spec/savon/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
it "should set the input tag to result in <getUser active='true'>" do
client.request(:get_user, :active => true) { soap.input.should == [nil, :getUser, { :active => true }] }
end

it "should use the :soap_action key to set the SOAPAction header" do
client.request(:get_user, :soap_action => :test_action) { http.headers["SOAPAction"].should == %{"testAction"} }
end
end

context "with two Symbols" do
Expand All @@ -138,6 +142,10 @@
it "should set the input tag to result in <wsdl:getUser active='true'>" do
client.request(:wsdl, :get_user, :active => true) { soap.input.should == [:wsdl, :getUser, { :active => true }] }
end

it "should use the :soap_action key to set the SOAPAction header" do
client.request(:wsdl, :get_user, :soap_action => :test_action) { http.headers["SOAPAction"].should == %{"testAction"} }
end
end

context "with a block expecting one argument" do
Expand Down

0 comments on commit 262de7c

Please sign in to comment.