Skip to content

Commit

Permalink
detect soap faults with http response code != 500
Browse files Browse the repository at this point in the history
the soap specification is a joke. a couple of years developing this and
i haven't found one server following the spec. reverting the check for
an http response code 500.
  • Loading branch information
rubiii committed Feb 15, 2011
1 parent de360a4 commit 771194c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion lib/savon/soap/fault.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def initialize(http)

# Returns whether a SOAP fault is present.
def present?
@present ||= http.code == 500 && http.body.include?("Fault>") && (soap1_fault? || soap2_fault?)
@present ||= http.body.include?("Fault>") && (soap1_fault? || soap2_fault?)
end

# Returns the SOAP fault message.
Expand Down
5 changes: 0 additions & 5 deletions spec/savon/soap/fault_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
it "should return false unless the HTTP response contains a SOAP fault" do
no_fault.should_not be_present
end

it "should return false if the HTTP response code is not 500" do
fault = Savon::SOAP::Fault.new new_response(:code => 200, :body => Fixture.response(:soap_fault))
fault.should_not be_present
end
end

[:message, :to_s].each do |method|
Expand Down

0 comments on commit 771194c

Please sign in to comment.