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

Changeset 1973

Show
Ignore:
Timestamp:
09/17/07 21:14:58 (8 months ago)
Author:
nahi
Message:
  • allow to remove mustUnderstand attribute from a SOAP Header. I heard that there's an implementation which cannot handle mustUnderstand existence. closes #429.
Files:

Legend:

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

    r1936 r1973  
    170170      @element.extraattr[key] = value 
    171171    end 
    172     @element.extraattr[AttrMustUnderstandName] = (@mustunderstand ? '1' : '0') 
     172    # to remove mustUnderstand attribute, set it to nil 
     173    unless @mustunderstand.nil? 
     174      @element.extraattr[AttrMustUnderstandName] = (@mustunderstand ? '1' : '0') 
     175    end 
    173176    if @encodingstyle 
    174177      @element.extraattr[AttrEncodingStyleName] = @encodingstyle 
     
    208211  def add(name, value) 
    209212    actor = value.extraattr[AttrActorName] 
    210     mu = (value.extraattr[AttrMustUnderstandName] == '1') 
     213    mu = value.extraattr[AttrMustUnderstandName] 
    211214    encstyle = value.extraattr[AttrEncodingStyleName] 
    212     item = SOAPHeaderItem.new(value, mu, encstyle, actor) 
     215    mu_value = mu.nil? ? nil : (mu == '1') 
     216    # to remove mustUnderstand attribute, set it to nil 
     217    item = SOAPHeaderItem.new(value, mu_value, encstyle, actor) 
    213218    super(name, item) 
    214219  end 
  • trunk/lib/soap/header/handler.rb

    r1833 r1973  
    1616class Handler 
    1717  attr_reader :elename 
    18   attr_reader :mustunderstand 
     18  attr_accessor :mustunderstand 
    1919  attr_reader :encodingstyle 
    2020  attr_reader :target_actor 
  • trunk/test/soap/test_custom_ns.rb

    r1954 r1973  
    1313    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    1414  <env:Header> 
    15       <n1:headeritem xmlns:n1="my:foo" 
    16           env:mustUnderstand="0">hi</n1:headeritem> 
     15      <n1:headeritem xmlns:n1="my:foo">hi</n1:headeritem> 
    1716  </env:Header> 
    1817  <env:Body> 
     
    3130    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    3231  <ENV:Header> 
    33       <myns:headeritem ENV:mustUnderstand="0">hi</myns:headeritem> 
     32      <myns:headeritem>hi</myns:headeritem> 
    3433  </ENV:Header> 
    3534  <ENV:Body> 
  • trunk/test/soap/test_extraattr.rb

    r1970 r1973  
    1515  <env:Header Id="extraattr"> 
    1616      <n1:headeritem xmlns:n1="my:foo" 
    17           env:mustUnderstand="0" 
    1817          Id="extraattr"></n1:headeritem> 
    1918  </env:Header>