Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1901

Show
Ignore:
Timestamp:
07/22/07 00:52:19 (1 year ago)
Author:
nahi
Message:
  • login.live.com returns SOAPFault as a direct child of SOAPEnvelope. support it even though it's not spec compliant. closes #384.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/parser.rb

    r1898 r1901  
    223223      parent.node.body = o 
    224224    elsif ele.name == EleFault 
    225       unless parent.node.is_a?(SOAPBody) 
    226         raise FormatDecodeError.new("Fault should be a child of Body.") 
    227       end 
    228       o = SOAPFault.new 
    229       parent.node.fault = o 
     225      if parent.node.is_a?(SOAPBody) 
     226        o = SOAPFault.new 
     227        parent.node.fault = o 
     228      elsif parent.node.is_a?(SOAPEnvelope) 
     229        # live.com server returns SOAPFault as a direct child of SOAPEnvelope. 
     230        # support it even if it's not spec compliant. 
     231        warn("Fault must be a child of Body.") 
     232        body = SOAPBody.new 
     233        parent.node.body = body 
     234        o = SOAPFault.new 
     235        body.fault = o 
     236      else 
     237        raise FormatDecodeError.new("Fault should be a child of Body.") 
     238      end 
    230239    end 
    231240    o.extraattr.update(attrs) if o